Package org.glassfish.pfl.test
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.TestSuiteThis 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 Classes Modifier and Type Class Description private classTestCaseTools.SingleInstanceTestSuite.SingleInstanceTestCaseA simple variant of JUnit's TestCase that invokes the test method on the supplied test.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.MethodpostMethodprivate java.lang.reflect.MethodsetUpMethodprivate java.lang.reflect.MethodtearDownMethodprivate junit.framework.Testtest
-
Constructor Summary
Constructors Constructor Description SingleInstanceTestSuite(java.lang.Class theClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddTestMethod(java.lang.reflect.Method m, java.util.Vector names, junit.framework.Test test)private junit.framework.TestdoWarning(java.lang.String message)private java.lang.StringexceptionToString(java.lang.Throwable t)private java.lang.reflect.MethodgetMethod(java.lang.Class theClass, java.lang.String name)private booleanisPublicTestMethod(java.lang.reflect.Method m)private booleanisTestMethod(java.lang.reflect.Method m)voidrun(junit.framework.TestResult result)voidrunTest(junit.framework.Test test, junit.framework.TestResult result)
-
-
-
Method Detail
-
getMethod
private java.lang.reflect.Method getMethod(java.lang.Class theClass, java.lang.String name)
-
addTestMethod
private void addTestMethod(java.lang.reflect.Method m, java.util.Vector names, junit.framework.Test test)
-
isPublicTestMethod
private boolean isPublicTestMethod(java.lang.reflect.Method m)
-
isTestMethod
private boolean isTestMethod(java.lang.reflect.Method m)
-
exceptionToString
private java.lang.String exceptionToString(java.lang.Throwable t)
-
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
private junit.framework.Test doWarning(java.lang.String message)
-
-