public abstract class TapestryTest
extends junit.framework.TestCase
doSetUp() and doTearDown().
I recommend that you create your own abstract class for you application tests
that subclasses this. You can then create a TapestryTester in that
class and store it in a static variable and also override
setUpForAllTestMethods() for any other common setup.
For example:
public abstract class MyApplicationTest extends TapestryTest {
private static final TapestryTester SHARED_TESTER = new TapestryTester(
"pac.ka.ge", MyTestInfrastructureModule.class);
public MyApplicationTest() {
super(SHARED_TESTER);
}
@Override
protected void setUpForAllTestClasses() throws Exception {
MockitoAnnotations.initMocks(this);
}
}
| Modifier and Type | Field and Description |
|---|---|
protected TapestryTester |
tester |
| Constructor and Description |
|---|
TapestryTest(TapestryTester tester)
Creates a new instance using the given
TapestryTester; you should
create this tester just once and share it across multiple tests,
for example by storing it in a static variable. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doSetUp()
Override this instead of
setUp() |
protected void |
doTearDown()
Override this instead of
tearDown() |
protected void |
setUp()
Override
doSetUp() instead. |
protected void |
setUpForAllTestClasses()
Deprecated.
Rename your method so that it overrides
setUpForAllTestMethods() |
protected void |
setUpForAllTestMethods()
See class javadoc for example:
TapestryTest |
protected void |
tearDown()
Override
doTearDown() instead. |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toStringassertEquals, 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, failNotEquals, failNotSame, failSame, formatprotected final TapestryTester tester
public TapestryTest(TapestryTester tester)
TapestryTester; you should
create this tester just once and share it across multiple tests,
for example by storing it in a static variable.tester - the tester to use (not null)@Deprecated protected void setUpForAllTestClasses() throws Exception
setUpForAllTestMethods()Exceptionprotected void setUpForAllTestMethods()
throws Exception
TapestryTestExceptionprotected final void setUp()
throws Exception
doSetUp() instead.setUp in class junit.framework.TestCaseExceptionprotected void doSetUp()
throws Exception
setUp()Exceptionprotected final void tearDown()
throws Exception
doTearDown() instead.tearDown in class junit.framework.TestCaseExceptionprotected void doTearDown()
throws Exception
tearDown()ExceptionCopyright © 2009-2012. All Rights Reserved.