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