mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-23 00:21:43 +01:00
Fixed ServerFileLoaderTest broken due to removal of print line
This commit is contained in:
parent
1522a8731d
commit
33de99cfab
@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
|
|
||||||
class ServerFileLoaderTest {
|
class ServerFileLoaderTest {
|
||||||
static PlanSystem system;
|
static PlanSystem system;
|
||||||
static ServerFileLoader underTest;
|
static ServerLoader underTest;
|
||||||
private static ServerUUID serverUUID;
|
private static ServerUUID serverUUID;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
@ -57,7 +57,9 @@ class ServerFileLoaderTest {
|
|||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUpEach() {
|
void setUpEach() {
|
||||||
underTest = new ServerFileLoader(TestConstants.VERSION, system.getPlanFiles(), system.getConfigSystem().getConfig());
|
underTest = new AtomicServerLoader(
|
||||||
|
new ServerFileLoader(TestConstants.VERSION, system.getPlanFiles(), system.getConfigSystem().getConfig())
|
||||||
|
);
|
||||||
Optional<Server> loaded = underTest.load(null);
|
Optional<Server> loaded = underTest.load(null);
|
||||||
assertTrue(loaded.isPresent());
|
assertTrue(loaded.isPresent());
|
||||||
|
|
||||||
@ -71,17 +73,21 @@ class ServerFileLoaderTest {
|
|||||||
ExecutorService executorService = new ScheduledThreadPoolExecutor(6);
|
ExecutorService executorService = new ScheduledThreadPoolExecutor(6);
|
||||||
|
|
||||||
AtomicInteger runs = new AtomicInteger(1);
|
AtomicInteger runs = new AtomicInteger(1);
|
||||||
int expected = 10000;
|
int expected = 1000;
|
||||||
AtomicInteger fails = new AtomicInteger(0);
|
AtomicInteger fails = new AtomicInteger(0);
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < expected; i++) {
|
for (int i = 0; i < expected; i++) {
|
||||||
executorService.submit(() -> {
|
executorService.submit(() -> {
|
||||||
|
try {
|
||||||
Optional<Server> load = underTest.load(null);
|
Optional<Server> load = underTest.load(null);
|
||||||
if (load.isPresent()) {
|
if (load.isPresent()) {
|
||||||
underTest.save(load.get());
|
underTest.save(load.get());
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Failure " + fails.incrementAndGet());
|
System.out.println("Failure " + fails.incrementAndGet());
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
runs.incrementAndGet();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Awaitility.await()
|
Awaitility.await()
|
||||||
|
Loading…
Reference in New Issue
Block a user