Fix Test Suite

This commit is contained in:
Fuzzlemann 2017-08-22 20:27:01 +02:00
parent 654ff26fb6
commit 5de5ea25a8
2 changed files with 8 additions and 3 deletions

View File

@ -213,7 +213,6 @@ public class DatabaseTest {
public void testTPSSaving() throws SQLException {
db.init();
TPSTable tpsTable = db.getTpsTable();
List<TPS> expected = new ArrayList<>();
Random r = new Random();
OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
@ -224,12 +223,17 @@ public class DatabaseTest {
final int entityCount = 6123;
final int chunksLoaded = 2134;
List<TPS> expected = new ArrayList<>();
expected.add(new TPS(r.nextLong(), r.nextDouble(), r.nextInt(100000000), averageCPUUsage, usedMemory, entityCount, chunksLoaded));
expected.add(new TPS(r.nextLong(), r.nextDouble(), r.nextInt(100000000), averageCPUUsage, usedMemory, entityCount, chunksLoaded));
expected.add(new TPS(r.nextLong(), r.nextDouble(), r.nextInt(100000000), averageCPUUsage, usedMemory, entityCount, chunksLoaded));
expected.add(new TPS(r.nextLong(), r.nextDouble(), r.nextInt(100000000), averageCPUUsage, usedMemory, entityCount, chunksLoaded));
List<TPS> tpsDataOld = tpsTable.getTPSData();
tpsTable.saveTPSData(expected);
expected.addAll(0, tpsDataOld);
assertEquals(expected, tpsTable.getTPSData());
}
}

View File

@ -4,6 +4,7 @@
*/
package test.java.utils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@ -24,7 +25,7 @@ public class DBTestSuite {
clean(true);
}
@BeforeClass
@AfterClass
public static void tearDown() throws IOException {
clean(false);
}
@ -37,7 +38,7 @@ public class DBTestSuite {
}
for (File f : testFolder.listFiles()) {
if (dbOnly && !f.getName().endsWith(".db")) {
if (dbOnly && !f.getName().contains(".db")) {
continue;
}