diff --git a/game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTests.java similarity index 91% rename from game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTest.java rename to game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTests.java index 2cb25f47..c96a03d3 100644 --- a/game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ChatMessageHandlerTests.java @@ -15,13 +15,13 @@ import static org.powermock.api.mockito.PowerMockito.*; @RunWith(PowerMockRunner.class) @PrepareForTest({Player.class}) -public class ChatMessageHandlerTest { +public final class ChatMessageHandlerTests { private final World world = new World(); private final ChatMessageHandler chatMessageHandler = new ChatMessageHandler(world); @Test - public void testTerminatedIfMuted() throws Exception { + public void terminateIfMuted() throws Exception { Player player = PowerMockito.mock(Player.class); when(player.isMuted()).thenReturn(true); diff --git a/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTests.java similarity index 84% rename from game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java rename to game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTests.java index 34d03c35..e332b067 100644 --- a/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTests.java @@ -19,11 +19,11 @@ import static org.powermock.api.mockito.PowerMockito.*; @RunWith(PowerMockRunner.class) @PrepareForTest({Player.class, ItemDefinition.class}) -public class ItemOnItemVerificationHandlerTest { +public final class ItemOnItemVerificationHandlerTests { - private World world = new World(); + private final World world = new World(); - private ItemOnItemVerificationHandler itemOnItemVerificationHandler = new ItemOnItemVerificationHandler(world); + private final ItemOnItemVerificationHandler itemOnItemVerificationHandler = new ItemOnItemVerificationHandler(world); @Before public void setupTestItemDefinitions() { @@ -32,7 +32,7 @@ public class ItemOnItemVerificationHandlerTest { } @Test - public void testTerminateWithNoTargetItem() throws Exception { + public void terminateWithNoTargetItem() throws Exception { Player player = mock(Player.class); Inventory inventory = new Inventory(28); inventory.set(1, new Item(4151, 1)); diff --git a/game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTests.java similarity index 95% rename from game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTest.java rename to game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTests.java index 0f391776..8d0908c0 100644 --- a/game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ItemOnObjectVerificationHandlerTests.java @@ -30,7 +30,7 @@ import static org.powermock.api.mockito.PowerMockito.*; @RunWith(PowerMockRunner.class) @PrepareForTest({Player.class, World.class, Region.class, RegionRepository.class, ObjectDefinition.class, ItemDefinition.class}) -public class ItemOnObjectVerificationHandlerTest { +public final class ItemOnObjectVerificationHandlerTests { @Before public void setupTestItemDefinitions() { @@ -43,7 +43,7 @@ public class ItemOnObjectVerificationHandlerTest { @Test - public void testTerminateIfInvalidItem() throws Exception { + public void terminateIfInvalidItem() throws Exception { Position playerPosition = new Position(3200, 3200); Position objectPosition = new Position(3200, 3216); @@ -73,7 +73,7 @@ public class ItemOnObjectVerificationHandlerTest { } @Test - public void testTerminateIfInvalidSlot() throws Exception { + public void terminateIfInvalidSlot() throws Exception { Position playerPosition = new Position(3200, 3200); Position objectPosition = new Position(3200, 3200); @@ -103,7 +103,7 @@ public class ItemOnObjectVerificationHandlerTest { } @Test - public void testTerminateIfObjectOutOfRange() throws Exception { + public void terminateIfObjectOutOfRange() throws Exception { Position playerPosition = new Position(3200, 3200); Position objectPosition = new Position(3200, 3200); diff --git a/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTests.java similarity index 95% rename from game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java rename to game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTests.java index 40cf72db..c4c396f6 100644 --- a/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTests.java @@ -28,7 +28,7 @@ import static org.powermock.api.mockito.PowerMockito.when; @RunWith(PowerMockRunner.class) @PrepareForTest({World.class, Player.class, ObjectDefinition.class, RegionRepository.class, Region.class}) -public class ObjectActionVerificationHandlerTest { +public final class ObjectActionVerificationHandlerTests { @Before public void setupTestObjectDefinitions() { @@ -37,7 +37,7 @@ public class ObjectActionVerificationHandlerTest { } @Test - public void testTerminateIfOutOfRange() throws Exception { + public void terminateIfOutOfRange() throws Exception { Position playerPosition = new Position(3200, 3200); Position objectPosition = new Position(3200, 3216); @@ -64,8 +64,7 @@ public class ObjectActionVerificationHandlerTest { } @Test - - public void testTerminateIfNoObject() throws Exception { + public void terminateIfNoObject() throws Exception { Position playerPosition = new Position(3200, 3200); Position objectPosition = new Position(3200, 3201); diff --git a/game/src/test/org/apollo/game/model/PositionTests.java b/game/src/test/org/apollo/game/model/PositionTests.java new file mode 100644 index 00000000..cfa5d5de --- /dev/null +++ b/game/src/test/org/apollo/game/model/PositionTests.java @@ -0,0 +1,36 @@ +package org.apollo.game.model; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests the {@link Position} class. + */ +public final class PositionTests { + + /** + * Tests the {@link Position#getHeight()} method. + */ + @Test + public void getHeight() { + Position position = new Position(3222, 3222, 3); + Assert.assertEquals(3, position.getHeight()); + } + + /** + * Tests the creation of an invalid {@link Position}. + */ + @Test(expected = IndexOutOfBoundsException.class) + public void createNegativePosition() { + new Position(3222, 3222, -1); + } + + /** + * Tests the creation of an invalid {@link Position}. + */ + @Test(expected = IndexOutOfBoundsException.class) + public void createOutOfBoundsPosition() { + new Position(3222, 3222, 4); + } + +} \ No newline at end of file diff --git a/game/src/test/org/apollo/game/model/TestPosition.java b/game/src/test/org/apollo/game/model/TestPosition.java deleted file mode 100644 index 8147aed9..00000000 --- a/game/src/test/org/apollo/game/model/TestPosition.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.apollo.game.model; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Tests the {@link Position} class. - * - * @author Ryley - */ -public final class TestPosition { - - /** - * Tests the {@link Position#getHeight()} method. - */ - @Test - public void testGetHeight() { - Position position = new Position(3222, 3222, 3); - Assert.assertEquals(3, position.getHeight()); - } - - /** - * Tests the creation of an invalid {@link Position}. - */ - @Test(expected = IndexOutOfBoundsException.class) - public void testCreateNegativePosition() { - new Position(3222, 3222, -1); - } - - /** - * Tests the creation of an invalid {@link Position}. - */ - @Test(expected = IndexOutOfBoundsException.class) - public void testCreateOutOfBoundsPosition() { - new Position(3222, 3222, 4); - } - -} \ No newline at end of file diff --git a/game/src/test/org/apollo/game/model/entity/MobRepositoryTest.java b/game/src/test/org/apollo/game/model/entity/MobRepositoryTests.java similarity index 92% rename from game/src/test/org/apollo/game/model/entity/MobRepositoryTest.java rename to game/src/test/org/apollo/game/model/entity/MobRepositoryTests.java index ff4272ec..0396789c 100644 --- a/game/src/test/org/apollo/game/model/entity/MobRepositoryTest.java +++ b/game/src/test/org/apollo/game/model/entity/MobRepositoryTests.java @@ -21,7 +21,7 @@ import org.powermock.modules.junit4.PowerMockRunner; */ @RunWith(PowerMockRunner.class) @PrepareForTest(Player.class) -public final class MobRepositoryTest { +public final class MobRepositoryTests { /** * The capacity of the MobRepository. @@ -32,7 +32,7 @@ public final class MobRepositoryTest { * Tests {@link MobRepository#capacity()}. */ @Test - public void testCapacity() { + public void capacity() { MobRepository players = new MobRepository<>(CAPACITY); assertEquals(CAPACITY, players.capacity()); @@ -42,7 +42,7 @@ public final class MobRepositoryTest { * Tests {@link MobRepository#add(Mob)}. */ @Test - public void testAdd() { + public void add() { MobRepository players = new MobRepository<>(CAPACITY); Player player = mock(Player.class); @@ -58,7 +58,7 @@ public final class MobRepositoryTest { * Tests {@link MobRepository#remove(Mob)}. */ @Test - public void testRemove() { + public void remove() { MobRepository players = new MobRepository<>(CAPACITY); Player player = mock(Player.class); @@ -77,7 +77,7 @@ public final class MobRepositoryTest { * Tests failing of {@link MobRepository#remove(Mob)} */ @Test(expected = NullPointerException.class) - public void testRemoveNull() { + public void removeNull() { MobRepository players = new MobRepository<>(CAPACITY); players.remove(null); } @@ -86,7 +86,7 @@ public final class MobRepositoryTest { * Ensures that a MobRepository maintains a fixed capacity. */ @Test - public void testCapacityExceeded() { + public void capacityExceeded() { MobRepository players = new MobRepository<>(CAPACITY); for (int index = 0; index < CAPACITY; index++) { @@ -107,7 +107,7 @@ public final class MobRepositoryTest { * Tests {@link Iterator#hasNext()} for a MobRepository. */ @Test - public void testIteratorHasNext() { + public void iteratorHasNext() { MobRepository players = new MobRepository<>(CAPACITY); Player player = mock(Player.class); @@ -123,7 +123,7 @@ public final class MobRepositoryTest { * Tests {@link Iterator#next()} for a MobRepository. */ @Test - public void testIteratorNext() { + public void iteratorNext() { MobRepository players = new MobRepository<>(CAPACITY); Player first = mock(Player.class); @@ -148,7 +148,7 @@ public final class MobRepositoryTest { * Tests {@link Iterator#remove()} for a MobRepository. */ @Test - public void testIteratorRemove() { + public void iteratorRemove() { MobRepository players = new MobRepository<>(CAPACITY); Player first = mock(Player.class); @@ -175,7 +175,7 @@ public final class MobRepositoryTest { * {@link NoSuchElementException} if the iterator contains no more elements. */ @Test(expected = NoSuchElementException.class) - public void testIteratorNextOverflow() { + public void iteratorNextOverflow() { MobRepository players = new MobRepository<>(CAPACITY); Player first = mock(Player.class); @@ -201,7 +201,7 @@ public final class MobRepositoryTest { * next(). */ @Test(expected = IllegalStateException.class) - public void testIteratorRemoveIllegalState() { + public void iteratorRemoveIllegalState() { MobRepository players = new MobRepository<>(CAPACITY); Player player = mock(Player.class); diff --git a/net/src/test/org/apollo/net/codec/game/TestGamePacketEncoder.java b/net/src/test/org/apollo/net/codec/game/GamePacketEncoderTests.java similarity index 96% rename from net/src/test/org/apollo/net/codec/game/TestGamePacketEncoder.java rename to net/src/test/org/apollo/net/codec/game/GamePacketEncoderTests.java index aa10b861..bba8860b 100644 --- a/net/src/test/org/apollo/net/codec/game/TestGamePacketEncoder.java +++ b/net/src/test/org/apollo/net/codec/game/GamePacketEncoderTests.java @@ -13,7 +13,7 @@ import static org.junit.Assert.assertEquals; * * @author Graham */ -public class TestGamePacketEncoder { +public class GamePacketEncoderTests { /** * Tests the {@link GamePacketEncoder#encode} method. @@ -21,7 +21,7 @@ public class TestGamePacketEncoder { * @throws Exception If an error occurs. */ @Test - public void testEncode() throws Exception { + public void encode() throws Exception { // generates 243, 141, 34, -223, 121... IsaacRandom random = new IsaacRandom(new int[] { 0, 0, 0, 0 }); GamePacketEncoder encoder = new GamePacketEncoder(random); diff --git a/util/src/test/org/apollo/util/xml/XmlParserTests.java b/util/src/test/org/apollo/util/xml/XmlParserTests.java index bbc59fb3..35df2c3a 100644 --- a/util/src/test/org/apollo/util/xml/XmlParserTests.java +++ b/util/src/test/org/apollo/util/xml/XmlParserTests.java @@ -29,7 +29,7 @@ public final class XmlParserTests { * @throws IOException If an I/O error occurs. */ @Test - public void testParseInputStream() throws SAXException, IOException { + public void parseInputStream() throws SAXException, IOException { XmlParser parser = new XmlParser(); InputStream input = new ByteArrayInputStream("".getBytes()); XmlNode root = parser.parse(input); @@ -76,7 +76,7 @@ public final class XmlParserTests { * @throws IOException If an I/O error occurs. */ @Test - public void testParseReader() throws SAXException, IOException { + public void parseReader() throws SAXException, IOException { XmlParser parser = new XmlParser(); Reader reader = new StringReader("123"); XmlNode root = parser.parse(reader);