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) }
  • Field Details

    • test

      private junit.framework.Test test
    • setUpMethod

      private Method setUpMethod
    • tearDownMethod

      private Method tearDownMethod
    • postMethod

      private Method postMethod
  • Constructor Details

    • SingleInstanceTestSuite

      public SingleInstanceTestSuite(Class theClass)
  • Method Details

    • getMethod

      private Method getMethod(Class theClass, String name)
    • addTestMethod

      private void addTestMethod(Method m, Vector names, junit.framework.Test test)
    • isPublicTestMethod

      private boolean isPublicTestMethod(Method m)
    • isTestMethod

      private boolean isTestMethod(Method m)
    • exceptionToString

      private String exceptionToString(Throwable t)
    • run

      public void run(junit.framework.TestResult result)
      Specified by:
      run in interface junit.framework.Test
      Overrides:
      run in class junit.framework.TestSuite
    • runTest

      public void runTest(junit.framework.Test test, junit.framework.TestResult result)
      Overrides:
      runTest in class junit.framework.TestSuite
    • doWarning

      private junit.framework.Test doWarning(String message)