junit.extensions
public class ExceptionTestCase extends TestCase
try { shouldThrow(); } catch (SpecialException e) { return; } fail("Expected SpecialException");To use ExceptionTestCase, create a TestCase like:
new ExceptionTestCase("testShouldThrow", SpecialException.class);
Constructor Summary | |
---|---|
ExceptionTestCase(String name, Class exception) |
Method Summary | |
---|---|
protected void | runTest()
Execute the test method expecting that an Exception of
class fExpected or one of its subclasses will be thrown |