Package gw.test

Class TestExecutionManager


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

      • _beforeTestSuiteRun

        private boolean _beforeTestSuiteRun
      • _typeSystemInitialized

        private boolean _typeSystemInitialized
      • _beforeTestSuiteFailed

        private java.lang.Throwable _beforeTestSuiteFailed
      • _beforeTestClassFailed

        private java.util.Map<java.lang.String,​java.lang.Throwable> _beforeTestClassFailed
      • _testWrappers

        private java.util.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 Detail

      • TestExecutionManager

        public TestExecutionManager()
    • Method Detail

      • setEnvironment

        public void setEnvironment​(TestEnvironment environment)
      • setTestsFromSuite

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

        public void setSuiteTimeoutInMillis​(long suiteTimeoutInMillis)
      • assertionsMustBeEnabled

        public boolean assertionsMustBeEnabled()
      • setAssertionsMustBeEnabled

        public void setAssertionsMustBeEnabled​(boolean assertionsMustBeEnabled)
      • runTestClass

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

        protected TestClass maybeUnwrapTestClass​(TestClass testClass)
      • runTestClassBare

        protected void runTestClassBare​(TestClass testClass)
                                 throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • maybeInitTypeSystem

        public void maybeInitTypeSystem()
      • callAfterTestMethod

        private void callAfterTestMethod​(TestClass testClass,
                                         java.lang.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​(java.lang.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()