Archived
0

переименование тестов

This commit is contained in:
2018-10-07 22:24:13 +03:00
parent 7225efced9
commit f5c8d93657
12 changed files with 39 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import java.util.concurrent.ThreadLocalRandom;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
class TestEntityLocation {
class EntityLocationTest {
private static final ThreadLocalRandom rnd = ThreadLocalRandom.current();
private static final double minD = 0.0d, maxD = 10.0d;
private static final float minF = 0.0f, maxF = 359.9f;
@@ -25,7 +25,7 @@ class TestEntityLocation {
}
@Test
void testEquals() {
void equals_() {
EntityLocation loc1 = new EntityLocation(x, y, z, yaw, pitch);
EntityLocation loc2 = new EntityLocation(x, y, z, yaw, pitch);
assertEquals(loc1, loc2);
@@ -38,14 +38,14 @@ class TestEntityLocation {
}
@Test
void testClone() {
void clone_() {
EntityLocation locOrig = new EntityLocation(x, y, z, yaw, pitch);
EntityLocation locClone = locOrig.clone();
assertEquals(locOrig, locClone);
}
@Test
void testGetBlockXZ() {
void getBlockXZ() {
EntityLocation location;
location = new EntityLocation(0d, 0, 0d, 0f, 0f);

View File

@@ -5,10 +5,10 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
class TestImmutableEntityLocation {
class ImmutableEntityLocationTest {
@Test
void testSetValue() {
void setValue() {
EntityLocation location = new ImmutableEntityLocation(1d, 2d, 3d, 4f, 5f);
assertThrows(UnsupportedOperationException.class, () -> {
@@ -24,7 +24,7 @@ class TestImmutableEntityLocation {
}
@Test
void testClone() {
void clone_() {
EntityLocation locOrig = new ImmutableEntityLocation(1d, 2d, 3d, 4f, 5f);
EntityLocation locClone = locOrig.clone();

View File

@@ -10,7 +10,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@Configuration
public class SpringConfig {
public class TestSpringConfig {
@Bean()
public World simpleMockWorld() {
return mock(World.class);

View File

@@ -4,9 +4,9 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class TestText {
class TextTest {
@Test
void testToPlain() {
void toPlain() {
final String m1 = "mes";
final String m2 = "sage";
final String message = m1 + m2;
@@ -26,7 +26,7 @@ class TestText {
}
@Test
void testEquals() {
void equals_() {
assertEquals(Text.of(), Text.of(""));
assertEquals(Text.of(), Text.builder().build());
assertEquals(Text.of(), Text.builder("").build());
@@ -44,7 +44,7 @@ class TestText {
}
@Test
void testEmpty() {
void isEmpty() {
assertTrue(Text.of().isEmpty());
assertTrue(Text.of((String) null).isEmpty());
assertTrue(Text.of((Text) null).isEmpty());

View File

@@ -6,9 +6,9 @@ import java.util.concurrent.ThreadLocalRandom;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestCompactedCoords {
class CompactedCoordsTest {
@Test
void testXZ() {
void compressXZ() {
ThreadLocalRandom random = ThreadLocalRandom.current();
for (int i = 0; i < 100; i++) {

View File

@@ -1,6 +1,5 @@
package mc.core;
package mc.core.world.block;
import mc.core.world.block.BlockLocation;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -9,7 +8,7 @@ import java.util.concurrent.ThreadLocalRandom;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
class TestBlockLocation {
class BlockLocationTest {
private static final ThreadLocalRandom rnd = ThreadLocalRandom.current();
private static final int minI = 0, maxI = 10;
private int x, y, z;
@@ -22,7 +21,7 @@ class TestBlockLocation {
}
@Test
void testEquals() {
void equals_() {
BlockLocation loc1 = new BlockLocation(x, y, z);
BlockLocation loc2 = new BlockLocation(x, y, z);
assertEquals(loc1, loc2);
@@ -32,7 +31,7 @@ class TestBlockLocation {
}
@Test
void testClone() {
void clone_() {
BlockLocation locOrig = new BlockLocation(x, y, z);
BlockLocation locClone = locOrig.clone();
assertEquals(locOrig, locClone);

View File

@@ -18,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.*;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {TestSpringConfig.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
class TestH2PlayerManager {
class H2PlayerManagerTest {
@Autowired
private H2PlayerService h2PlayerService;
@Autowired
@@ -27,7 +27,7 @@ class TestH2PlayerManager {
private H2PlayerManager playerManager;
@Test
void testCreatePlayer() {
void createPlayer() {
final String playerName = "NEW_PLAYER";
final Player newPlayer = playerManager.createPlayer(playerName, EntityLocation.ZERO(), mockWorld);
@@ -45,7 +45,7 @@ class TestH2PlayerManager {
}
@Test
void testJoinServer() {
void joinServer() {
assertEquals(0, playerManager.getCountPlayers());
final String playerName = "NEW_PLAYER";
@@ -57,7 +57,7 @@ class TestH2PlayerManager {
}
@Test
void testLeftServer() {
void leftServer() {
assertEquals(0, playerManager.getCountPlayers());
final String playerName = "NEW_PLAYER";
@@ -87,7 +87,7 @@ class TestH2PlayerManager {
}
@Test
void testGetPlayer() {
void getPlayer() {
assertEquals(0, playerManager.getCountPlayers());
final String playerName = "NEW_PLAYER";
@@ -104,7 +104,7 @@ class TestH2PlayerManager {
}
@Test
void testGetPlayers() {
void getPlayers() {
assertEquals(0, playerManager.getCountPlayers());
final String playerName = "NEW_PLAYER";
@@ -128,7 +128,7 @@ class TestH2PlayerManager {
}
@Test
void testGetCountPlayers() {
void getCountPlayers() {
assertEquals(0, playerManager.getCountPlayers());
final String playerName = "NEW_PLAYER";
@@ -145,7 +145,7 @@ class TestH2PlayerManager {
}
@Test
void testGetOfflinePlayer() {
void getOfflinePlayer() {
final String playerName = "NEW_PLAYER";
final Player player = playerManager.createPlayer(playerName, EntityLocation.ZERO(), mockWorld);
playerManager.joinServer(player);

View File

@@ -7,9 +7,9 @@ import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
class TestH2Player {
class H2PlayerTest {
@Test
void testEquals() {
void equals_() {
UUID uuid = UUID.randomUUID();
H2Player player1 = new H2Player();

View File

@@ -7,11 +7,11 @@ import java.util.Random;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestByteArrayInputNetStream {
class ByteArrayInputNetStreamTest {
private Random rnd = new Random();
@Test
void testReadByte() {
void readByte() {
final byte b0 = (byte) rnd.nextInt();
ByteArrayOutputNetStream netStream = new ByteArrayOutputNetStream();
netStream.writeByte(b0);
@@ -23,7 +23,7 @@ class TestByteArrayInputNetStream {
}
@Test
void testReadInt() {
void readInt() {
final int i0 = rnd.nextInt();
ByteArrayOutputNetStream netStream = new ByteArrayOutputNetStream();
netStream.writeInt(i0);
@@ -35,7 +35,7 @@ class TestByteArrayInputNetStream {
}
@Test
void testReadFloat() {
void readFloat() {
final float f0 = rnd.nextFloat();
ByteArrayOutputNetStream netStream = new ByteArrayOutputNetStream();
netStream.writeFloat(f0);

View File

@@ -22,13 +22,13 @@ import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
class TestChunkdataPacket {
class ChunkdataPacketTest {
private static byte[] expectedPacketData;
private World world;
@BeforeAll
static void beforeClassTest() throws IOException {
InputStream inputStream = TestChunkdataPacket.class.getResourceAsStream("ChunkDataPacket.bin");
InputStream inputStream = ChunkdataPacketTest.class.getResourceAsStream("ChunkDataPacket.bin");
expectedPacketData = ByteStreams.toByteArray(inputStream);
}
@@ -77,7 +77,7 @@ class TestChunkdataPacket {
}
@Test
void test() {
void writePacket() {
ChunkDataPacket packet = new ChunkDataPacket();
packet.setX(0);
packet.setZ(0);

View File

@@ -8,7 +8,7 @@ import java.util.Random;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestPlayerAbilitiesPacket {
class PlayerAbilitiesPacketTest {
private Random rnd = new Random();
private PlayerAbilitiesPacket packet;
@@ -23,7 +23,7 @@ class TestPlayerAbilitiesPacket {
}
@Test
void test() {
void writePacket() {
ByteArrayOutputNetStream netOutputStream = new ByteArrayOutputNetStream();
packet.writeSelf(netOutputStream);

View File

@@ -8,7 +8,7 @@ import java.util.concurrent.ThreadLocalRandom;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestBlockLocationSerializer {
class BlockLocationSerializerTest {
private static final ThreadLocalRandom rnd = ThreadLocalRandom.current();
private static final int minI = 0, maxI = 10;
private int x, y, z;
@@ -21,7 +21,7 @@ class TestBlockLocationSerializer {
}
@Test
void test() {
void serialize() {
BlockLocation location = new BlockLocation(x, y, z);
final long serializedCoords = BlockLocationSerializer.toLong(location);