|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestSuite
consciouscode.junit.TestSuite
consciouscode.junit.SharedFixtureTestSuite
public class SharedFixtureTestSuite
A JUnit TestSuite that provides a shared fixture for its collected Tests.
This class's setUp()
method is called once before any of the
collected tests are run, and the tearDown()
method is called once
after the tests are done running.
Constructor Summary | |
---|---|
SharedFixtureTestSuite()
|
|
SharedFixtureTestSuite(Class<?> theClass)
Constructs a TestSuite from the given class. |
|
SharedFixtureTestSuite(String name)
Constructs an empty TestSuite. |
Method Summary | |
---|---|
void |
addTestSuite(Class testClass)
Adds a given TestSuite to this suite, or generates a new suite from a given class. |
protected Object |
getSharedFixture()
Determine the shared fixture object that is passed to the collected tests. |
void |
run(junit.framework.TestResult result)
|
void |
runCollectedTests(junit.framework.TestResult result)
|
void |
runTest(junit.framework.Test test,
junit.framework.TestResult result)
|
void |
setSharedFixture(Object fixture)
Set the shared fixture object shared by all tests within a SharedFixtureTestSuite. |
protected void |
setUp()
Sets up the shared fixture for the collected tests. |
protected void |
tearDown()
Tears down the shared fixture, for example, close a network connection. |
Methods inherited from class consciouscode.junit.TestSuite |
---|
classExtendsTestSuite |
Methods inherited from class junit.framework.TestSuite |
---|
addTest, countTestCases, createTest, getName, getTestConstructor, setName, testAt, testCount, tests, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface junit.framework.Test |
---|
countTestCases |
Constructor Detail |
---|
public SharedFixtureTestSuite()
public SharedFixtureTestSuite(Class<?> theClass)
public SharedFixtureTestSuite(String name)
Method Detail |
---|
public void addTestSuite(Class testClass)
TestSuite
suiteClass
is a subclass of
junit.framework.TestSuite
,
then its public no-argument constructor is called, and the resulting
instance is added to this suite. Otherwise, it is passed to the
superclass implementation, which will attempt to generate a TestSuite
from all the methods starting with "test" that take no arguments.
addTestSuite
in class TestSuite
testClass
- Must extend either
TestSuite
or
TestCase
.public void run(junit.framework.TestResult result)
run
in interface junit.framework.Test
run
in class junit.framework.TestSuite
public void runTest(junit.framework.Test test, junit.framework.TestResult result)
runTest
in class junit.framework.TestSuite
public void runCollectedTests(junit.framework.TestResult result)
public void setSharedFixture(Object fixture)
SharedFixtureTest
SharedFixtureTestSuite
just before
the test's setUp
method is called.
setSharedFixture
in interface SharedFixtureTest
protected Object getSharedFixture()
setUp()
, and the result is passed to the
SharedFixtureTest.setSharedFixture(java.lang.Object)
method (if applicable) of
each collected test.
By default, the shared fixture is null; subclass suites should set the fixture in their setUp method.
protected void setUp() throws Exception
Exception
protected void tearDown() throws Exception
This implementation simply releases the shared fixture; subclasses must call here if they override this method!
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |