mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-06 15:44:49 +08:00
Fix Test Suite
This commit is contained in:
parent
654ff26fb6
commit
5de5ea25a8
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user