Enable checkstyle on test sources

This commit is contained in:
chivesrs
2019-03-04 14:56:04 -05:00
committed by Adam
parent 2cf177688f
commit 2427f61f37
10 changed files with 21 additions and 19 deletions

View File

@@ -26,7 +26,6 @@
package net.runelite.http.service.hiscore;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import net.runelite.http.api.hiscore.HiscoreResult;
import okhttp3.HttpUrl;

View File

@@ -219,6 +219,7 @@
<configLocation>checkstyle.xml</configLocation>
<!-- exclude generated sources from checkstyle https://stackoverflow.com/a/30406454/7189686 -->
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</plugin>
</plugins>

View File

@@ -342,7 +342,8 @@ public class ItemVariationMappingTest
@Test
public void testMappedNames()
{
ITEMS_MAP.forEach((key, value) -> {
ITEMS_MAP.forEach((key, value) ->
{
assertEquals(value, (Integer) ItemVariationMapping.map(key));
});
}

View File

@@ -35,15 +35,11 @@ import net.runelite.api.Item;
import net.runelite.api.ItemComposition;
import net.runelite.api.ItemContainer;
import net.runelite.api.ItemID;
import net.runelite.api.queries.BankItemQuery;
import net.runelite.api.widgets.WidgetItem;
import net.runelite.client.game.ItemManager;
import net.runelite.client.util.QueryRunner;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -116,4 +112,4 @@ public class BankCalculationTest
long value = bankCalculation.getHaPrice();
assertTrue(value > Integer.MAX_VALUE);
}
}
}

View File

@@ -64,7 +64,8 @@ public class CombatLevelPluginTest
when(client.getLocalPlayer()).thenReturn(player);
}
private HashMap<String, Double> getBaseValues() {
private HashMap<String, Double> getBaseValues()
{
int attackLevel = client.getRealSkillLevel(Skill.ATTACK);
int strengthLevel = client.getRealSkillLevel(Skill.STRENGTH);
int defenceLevel = client.getRealSkillLevel(Skill.DEFENCE);

View File

@@ -31,7 +31,8 @@ public class HiscorePanelTest
@Test
public void testConstructor()
{
new HiscorePanel(new HiscoreConfig() {});
new HiscorePanel(new HiscoreConfig()
{
});
}
}

View File

@@ -25,7 +25,6 @@
package net.runelite.client.plugins.timetracking.clocks;
import java.time.format.DateTimeParseException;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

View File

@@ -27,7 +27,6 @@ package net.runelite.client.ui.overlay.components;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Point;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -85,4 +84,4 @@ public class TextComponentTest
verify(graphics, atLeastOnce()).setColor(Color.BLUE);
verify(graphics, atLeastOnce()).setColor(Color.GREEN);
}
}
}

View File

@@ -49,7 +49,8 @@ public class ColorUtilTest
@Test
public void colorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) -> {
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">", ColorUtil.colorTag(color));
});
}
@@ -57,7 +58,8 @@ public class ColorUtilTest
@Test
public void prependColorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) -> {
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">test", ColorUtil.prependColorTag("test", color));
assertEquals("<col=" + hex + ">", ColorUtil.prependColorTag("", color));
});
@@ -68,7 +70,8 @@ public class ColorUtilTest
@Test
public void wrapWithColorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) -> {
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">test</col>", ColorUtil.wrapWithColorTag("test", color));
assertEquals("<col=" + hex + "></col>", ColorUtil.wrapWithColorTag("", color));
});
@@ -77,7 +80,8 @@ public class ColorUtilTest
@Test
public void toHexColor()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) -> {
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("#" + hex, ColorUtil.toHexColor(color));
});
}
@@ -94,7 +98,8 @@ public class ColorUtilTest
@Test
public void colorToHexCode()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) -> {
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals(hex, ColorUtil.colorToHexCode(color));
});
}

View File

@@ -304,7 +304,7 @@ public class ImageUtilTest
// outlineImage(BufferedImage image, Color color, Predicate<Color> fillCondition, Boolean outlineCorners)
test = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
test.setRGB(2, 2, BLACK.getRGB());
test.setRGB(1,2, new Color(50, 50, 50).getRGB());
test.setRGB(1, 2, new Color(50, 50, 50).getRGB());
test.setRGB(3, 2, new Color(100, 100, 100).getRGB());
test.setRGB(2, 3, new Color(150, 150, 150).getRGB());
expected = test;