Added a more scattered test.

This may be a more realistic representation.
This commit is contained in:
Harrison Deng 2020-04-28 23:22:43 -05:00
parent 8595ab0c4e
commit 437a3acdcc

View File

@ -106,4 +106,30 @@ public class UniBiomeIslandGeneratorTest {
assertFalse(false, e.getCause().getMessage());
}
}
@Test
public void testBiomeGenerationMultithread1608ChunksScattered() {
int chunksToDoEach = 268;
Runnable g1 = new BiomeGenTask(chunksToDoEach, 0);
Runnable g2 = new BiomeGenTask(chunksToDoEach, 2);
Runnable g3 = new BiomeGenTask(chunksToDoEach, 4);
Runnable g4 = new BiomeGenTask(chunksToDoEach, 6);
Runnable g5 = new BiomeGenTask(chunksToDoEach, 8);
Runnable g6 = new BiomeGenTask(chunksToDoEach, 10);
ExecutorService ex = Executors.newFixedThreadPool(6);
ex.execute(g1);
ex.execute(g2);
ex.execute(g3);
ex.execute(g4);
ex.execute(g5);
ex.execute(g6);
try {
ex.shutdown();
assertTrue(ex.awaitTermination(1, TimeUnit.MINUTES), "timed out.");
} catch (InterruptedException e) {
assertFalse(false);
}
}
}