Altered ParticlePool contructorTest() to use JUnit's built in Exception
testing framework.
@@ -105,7 +105,7 @@ private static void fillWithRandom(ParticlePool pool, int nr) {
}
}
- @Test
+ @Test(expected = IllegalArgumentException.class)
public void constructorTest() {
final int[] poolSizes = {1, 27, 133};
@@ -124,13 +124,9 @@ public void constructorTest() {
assertEquals(size * 4, pool.color.length);
}
-
- try {
+ // Should throw exception after creating the pool
ParticlePool pool = new ParticlePool(0);
- fail();
- } catch (IllegalArgumentException e) {
- assertTrue(true); //succeed
- }
+
}
@Test
