|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
ch.agent.crnickl.junit.AbstractTest
public class AbstractTest
| Constructor Summary | |
|---|---|
AbstractTest()
|
|
| Method Summary | |
|---|---|
protected static void |
assertException(Exception e,
String... keys)
Verify an exception and its cause chain against a series of keys. |
protected static void |
expectException()
Fail with a message stating that an exception should have been thrown. |
protected void |
firstSetUp()
This method is called by setUp() before the first test. |
protected Context |
getContext()
|
protected void |
lastTearDown()
This method is called by tearDown() after the last test. |
protected void |
setUp()
|
protected void |
tearDown()
|
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTest()
| Method Detail |
|---|
protected Context getContext()
protected void setUp()
throws Exception
setUp in class junit.framework.TestCaseException
protected void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseException
protected void firstSetUp()
throws Exception
setUp() before the first test.
So if you override setUp, you must call super.
By default the method does nothing.
Exception
protected void lastTearDown()
throws Exception
tearDown() after the last test.
So if you override tearDown, you must call super.
By default the method does nothing.
Exceptionprotected static void expectException()
protected static void assertException(Exception e,
String... keys)
KeyedException and its key matches.
A null key in the argument list skips a level in the cause chain.
For example the following line asserts that the cause
of exception e has a key equal to "foo":
Skipping all levels is equivalent to failing on the original exception. For example the two following lines have the same effect:assertException(e, null, "foo");
assertException(new RuntimeException("foo")); fail(new RuntimeException("foo").toString());
e - an exceptionkeys - a list of strings
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||