Instead of using code like below to test that an exception is thrown:
public void testSomething() {
try {
int[] results = match("[G]", "CCN");
Assert.fail("Should throw an exception if G is not followed by a number");
} catch (IllegalArgumentException pe) {
Assert.assertTrue(true);
}
}
... the unit test should use the JUnit4 @Test approach, like:
@Test(expected=IllegalArgumentException.class)
public void testSomething() {
int[] results = match("[G]", "CCN");
}
This happens at several places in the current 'master' branch.