Package gw.test
Class TestExecutionManager
java.lang.Object
gw.test.TestExecutionManager
The TestExecutionManager class is responsible for the actual execution of tests, including executing the before/after
hooks.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private Throwable
private boolean
private TestEnvironment
private boolean
private long
private long
private long
private long
private final Map<String,
TestExecutionManager.TestInfo> private List<junit.framework.TestSuite>
private boolean
private static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
private void
callAfterTestMethod
(TestClass testClass, Throwable e) private void
callBeforeTestMethod
(TestClass testClass) final long
final boolean
final boolean
private boolean
isLastTestInSuite
(TestClass test) (package private) final void
private void
maybeCallAfterTestClass
(TestClass testClass) private void
private void
maybeCallBeforeTestClass
(TestClass testClass) private void
void
protected TestClass
maybeUnwrapTestClass
(TestClass testClass) private void
printTestRunTime
(String msg, long nanoTime) private org.junit.runner.Result
runImpl
(junit.framework.Test test) protected void
runTestClass
(TestClass testClass, junit.framework.TestResult result) protected void
runTestClassBare
(TestClass testClass) final boolean
A convenience method for running this suite from a main method.void
setAssertionsMustBeEnabled
(boolean assertionsMustBeEnabled) void
setEnvironment
(TestEnvironment environment) void
setSuiteTimeoutInMillis
(long suiteTimeoutInMillis) void
setTestsFromSuite
(List<junit.framework.TestSuite> testWrappers)
-
Field Details
-
_environment
-
_beforeTestSuiteRun
private boolean _beforeTestSuiteRun -
_typeSystemInitialized
private boolean _typeSystemInitialized -
_beforeTestSuiteFailed
-
_beforeTestClassFailed
-
_testInfos
-
_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
-
setTestsFromSuite
-
setSuiteTimeoutInMillis
public void setSuiteTimeoutInMillis(long suiteTimeoutInMillis) -
assertionsMustBeEnabled
public boolean assertionsMustBeEnabled() -
setAssertionsMustBeEnabled
public void setAssertionsMustBeEnabled(boolean assertionsMustBeEnabled) -
getEnvironment
-
runTestClass
-
maybeUnwrapTestClass
-
runTestClassBare
- Throws:
Throwable
-
maybeInitTypeSystem
public void maybeInitTypeSystem() -
callAfterTestMethod
-
callBeforeTestMethod
-
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
-
maybeCallAfterTestClass
-
maybeCallAfterTestSuite
-
printTestRunTime
-
isLastTestInSuite
-
hasTimeOut
public final boolean hasTimeOut() -
getTimeoutForCurrentTest
public final long getTimeoutForCurrentTest() -
markTimedOut
final void markTimedOut() -
hasTimedOut
public final boolean hasTimedOut()
-