Package gw.test

Class TestExecutionManager

java.lang.Object
gw.test.TestExecutionManager

public class TestExecutionManager extends Object
The TestExecutionManager class is responsible for the actual execution of tests, including executing the before/after hooks.
  • Field Details

    • _environment

      private TestEnvironment _environment
    • _beforeTestSuiteRun

      private boolean _beforeTestSuiteRun
    • _typeSystemInitialized

      private boolean _typeSystemInitialized
    • _beforeTestSuiteFailed

      private Throwable _beforeTestSuiteFailed
    • _beforeTestClassFailed

      private Map<String,Throwable> _beforeTestClassFailed
    • _testInfos

      private final Map<String,TestExecutionManager.TestInfo> _testInfos
    • _testWrappers

      private List<junit.framework.TestSuite> _testWrappers
    • _suiteStartTime

      private long _suiteStartTime
    • _suiteTimeoutInMillis

      private long _suiteTimeoutInMillis
    • _suiteHasTimedOut

      private boolean _suiteHasTimedOut
    • _assertionsMustBeEnabled

      private boolean _assertionsMustBeEnabled
    • _testClassStartTime

      private long _testClassStartTime
    • _suiteStartTimeNs

      private long _suiteStartTimeNs
    • INCLUDE_TEST_TIMING_INFO

      private static boolean INCLUDE_TEST_TIMING_INFO
  • Constructor Details

    • TestExecutionManager

      public TestExecutionManager()
  • Method Details

    • setEnvironment

      public void setEnvironment(TestEnvironment environment)
    • setTestsFromSuite

      public void setTestsFromSuite(List<junit.framework.TestSuite> testWrappers)
    • setSuiteTimeoutInMillis

      public void setSuiteTimeoutInMillis(long suiteTimeoutInMillis)
    • assertionsMustBeEnabled

      public boolean assertionsMustBeEnabled()
    • setAssertionsMustBeEnabled

      public void setAssertionsMustBeEnabled(boolean assertionsMustBeEnabled)
    • getEnvironment

      public TestEnvironment getEnvironment()
    • runTestClass

      protected void runTestClass(TestClass testClass, junit.framework.TestResult result)
    • maybeUnwrapTestClass

      protected TestClass maybeUnwrapTestClass(TestClass testClass)
    • runTestClassBare

      protected void runTestClassBare(TestClass testClass) throws Throwable
      Throws:
      Throwable
    • maybeInitTypeSystem

      public void maybeInitTypeSystem()
    • callAfterTestMethod

      private void callAfterTestMethod(TestClass testClass, Throwable e)
    • callBeforeTestMethod

      private void callBeforeTestMethod(TestClass testClass)
    • maybeCallBeforeTestSuite

      private void maybeCallBeforeTestSuite()
    • runViaStaticSuiteMethod

      public final boolean runViaStaticSuiteMethod()
      A convenience method for running this suite from a main method. Subclasses of Suite can create a main method like so:
         public static void main(String[] args) {
           System.exit( new GosuSuite().runSuite() ? 0 : 1 );
         }
       
      Returns:
      a boolean saying if all tests passed
    • runImpl

      private org.junit.runner.Result runImpl(junit.framework.Test test)
    • maybeCallBeforeTestClass

      private void maybeCallBeforeTestClass(TestClass testClass)
    • maybeCallAfterTestClass

      private void maybeCallAfterTestClass(TestClass testClass)
    • maybeCallAfterTestSuite

      private void maybeCallAfterTestSuite(TestClass test)
    • printTestRunTime

      private void printTestRunTime(String msg, long nanoTime)
    • isLastTestInSuite

      private boolean isLastTestInSuite(TestClass test)
    • hasTimeOut

      public final boolean hasTimeOut()
    • getTimeoutForCurrentTest

      public final long getTimeoutForCurrentTest()
    • markTimedOut

      final void markTimedOut()
    • hasTimedOut

      public final boolean hasTimedOut()