org.apache.cactus.sample.servlet.unit
public class: TestTearDownException [javadoc |
source]
java.lang.Object
junit.framework.TestCase
org.apache.cactus.internal.AbstractCactusTestCase
org.apache.cactus.ServletTestCase
org.apache.cactus.sample.servlet.unit.TestTearDownException
All Implemented Interfaces:
CactusTestCase
Test that
tearDown() is called even when an exception
occurs during the test.
- version:
$ - Id: TestTearDownException.java 238816 2004-02-29 16:36:46Z vmassol $
| Method from org.apache.cactus.sample.servlet.unit.TestTearDownException Detail: |
public void runBare() {
try
{
super.runBare();
}
catch (Throwable e)
{
assertEquals("testTearDown() worked", e.getMessage());
}
}
Intercepts running test cases to check for normal exceptions. |
public void tearDown() {
throw new AssertionFailedError("testTearDown() worked");
}
Verify that the tearDown() is always called even when there
is an exception raised during the test. |
public void testTearDown() throws Exception {
// Provoke an exception
fail("provoked error");
}
Verify that the tearDown() is always called even when there
is an exception raised during the test. |