diff --git a/src/test/java/ca/recrown/islandsurvivalcraft/world/generation/UniBiomeIslandGeneratorTest.java b/src/test/java/ca/recrown/islandsurvivalcraft/world/generation/UniBiomeIslandGeneratorTest.java index e142d67..7e3e7b7 100644 --- a/src/test/java/ca/recrown/islandsurvivalcraft/world/generation/UniBiomeIslandGeneratorTest.java +++ b/src/test/java/ca/recrown/islandsurvivalcraft/world/generation/UniBiomeIslandGeneratorTest.java @@ -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); + } + } } \ No newline at end of file