Class TestCaseTools.SingleInstanceTestSuite
java.lang.Object
junit.framework.TestSuite
org.glassfish.pfl.test.TestCaseTools.SingleInstanceTestSuite
- All Implemented Interfaces:
junit.framework.Test
- Enclosing class:
TestCaseTools
public static class TestCaseTools.SingleInstanceTestSuite
extends junit.framework.TestSuite
This is a special version of TestSuite that fixes, once and for
all, the irritating design of JUnit to invoke the constructor
multiple times on a test class. This operates as follows:
construct an instance of the test class in inst
try {
for each test method
method.invoke( inst ) ;
} catch ... {
} finally {
invoke post method (if any)
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA simple variant of JUnit's TestCase that invokes the test method on the supplied test. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTestMethod(Method m, Vector names, junit.framework.Test test) private junit.framework.Testprivate Stringprivate Methodprivate booleanprivate booleanvoidrun(junit.framework.TestResult result) voidrunTest(junit.framework.Test test, junit.framework.TestResult result) Methods inherited from class junit.framework.TestSuite
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, setName, testAt, testCount, tests, toString, warning
-
Field Details
-
test
private junit.framework.Test test -
setUpMethod
-
tearDownMethod
-
postMethod
-
-
Constructor Details
-
SingleInstanceTestSuite
-
-
Method Details
-
getMethod
-
addTestMethod
-
isPublicTestMethod
-
isTestMethod
-
exceptionToString
-
run
public void run(junit.framework.TestResult result) - Specified by:
runin interfacejunit.framework.Test- Overrides:
runin classjunit.framework.TestSuite
-
runTest
public void runTest(junit.framework.Test test, junit.framework.TestResult result) - Overrides:
runTestin classjunit.framework.TestSuite
-
doWarning
-