Package gw.test
Class TestExecutionManager
- java.lang.Object
-
- gw.test.TestExecutionManager
-
public class TestExecutionManager extends java.lang.ObjectThe TestExecutionManager class is responsible for the actual execution of tests, including executing the before/after hooks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTestExecutionManager.TestInfo
-
Field Summary
Fields Modifier and Type Field Description private boolean_assertionsMustBeEnabledprivate java.util.Map<java.lang.String,java.lang.Throwable>_beforeTestClassFailedprivate java.lang.Throwable_beforeTestSuiteFailedprivate boolean_beforeTestSuiteRunprivate TestEnvironment_environmentprivate boolean_suiteHasTimedOutprivate long_suiteStartTimeprivate long_suiteStartTimeNsprivate long_suiteTimeoutInMillisprivate long_testClassStartTimeprivate java.util.Map<java.lang.String,TestExecutionManager.TestInfo>_testInfosprivate java.util.List<junit.framework.TestSuite>_testWrappersprivate boolean_typeSystemInitializedprivate static booleanINCLUDE_TEST_TIMING_INFO
-
Constructor Summary
Constructors Constructor Description TestExecutionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanassertionsMustBeEnabled()private voidcallAfterTestMethod(TestClass testClass, java.lang.Throwable e)private voidcallBeforeTestMethod(TestClass testClass)TestEnvironmentgetEnvironment()longgetTimeoutForCurrentTest()booleanhasTimedOut()booleanhasTimeOut()private booleanisLastTestInSuite(TestClass test)(package private) voidmarkTimedOut()private voidmaybeCallAfterTestClass(TestClass testClass)private voidmaybeCallAfterTestSuite(TestClass test)private voidmaybeCallBeforeTestClass(TestClass testClass)private voidmaybeCallBeforeTestSuite()voidmaybeInitTypeSystem()protected TestClassmaybeUnwrapTestClass(TestClass testClass)private voidprintTestRunTime(java.lang.String msg, long nanoTime)private org.junit.runner.ResultrunImpl(junit.framework.Test test)protected voidrunTestClass(TestClass testClass, junit.framework.TestResult result)protected voidrunTestClassBare(TestClass testClass)booleanrunViaStaticSuiteMethod()A convenience method for running this suite from a main method.voidsetAssertionsMustBeEnabled(boolean assertionsMustBeEnabled)voidsetEnvironment(TestEnvironment environment)voidsetSuiteTimeoutInMillis(long suiteTimeoutInMillis)voidsetTestsFromSuite(java.util.List<junit.framework.TestSuite> testWrappers)
-
-
-
Field Detail
-
_environment
private TestEnvironment _environment
-
_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
-
_testInfos
private final java.util.Map<java.lang.String,TestExecutionManager.TestInfo> _testInfos
-
_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
-
-
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)
-
getEnvironment
public TestEnvironment getEnvironment()
-
runTestClass
protected void runTestClass(TestClass testClass, junit.framework.TestResult result)
-
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()
-
-