Class TestMethod
- java.lang.Object
-
- org.apache.maven.surefire.junitcore.TestMethod
-
- All Implemented Interfaces:
ConsoleOutputReceiver
class TestMethod extends java.lang.Object implements ConsoleOutputReceiver
Represents the test-state of a single test method that is run.
Notes about thread safety: This instance is serially confined to 1-3 threads (construction, test-run, reporting), without any actual parallel access
-
-
Field Summary
Fields Modifier and Type Field Description private ReportEntry
description
private long
endTime
private java.util.concurrent.atomic.AtomicReference<LogicalStream>
output
private long
startTime
private static java.lang.InheritableThreadLocal<TestMethod>
TEST_METHOD
private ReportEntry
testAssumption
private ReportEntry
testError
private ReportEntry
testFailure
private ReportEntry
testIgnored
private TestSet
testSet
-
Constructor Summary
Constructors Constructor Description TestMethod(ReportEntry description, TestSet testSet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
attachToThread()
private ReportEntry
createReportEntry(ReportEntry reportEntry)
(package private) void
detachFromCurrentThread()
(package private) int
getElapsed()
(package private) long
getEndTime()
(package private) LogicalStream
getLogicalStream()
(package private) long
getStartTime()
(package private) TestSet
getTestSet()
(package private) static TestMethod
getThreadTestMethod()
(package private) void
replay(RunListener reporter)
private void
setEndTime()
(package private) void
testAssumption(ReportEntry failure)
(package private) void
testError(ReportEntry failure)
(package private) void
testFailure(ReportEntry failure)
(package private) void
testFinished()
(package private) void
testIgnored(ReportEntry description)
void
writeTestOutput(java.lang.String output, boolean newLine, boolean stdout)
Forwards process output from the running test-case into the reporting system
-
-
-
Field Detail
-
TEST_METHOD
private static final java.lang.InheritableThreadLocal<TestMethod> TEST_METHOD
-
output
private final java.util.concurrent.atomic.AtomicReference<LogicalStream> output
-
description
private final ReportEntry description
-
testSet
private final TestSet testSet
-
startTime
private final long startTime
-
endTime
private volatile long endTime
-
testFailure
private volatile ReportEntry testFailure
-
testError
private volatile ReportEntry testError
-
testIgnored
private volatile ReportEntry testIgnored
-
testAssumption
private volatile ReportEntry testAssumption
-
-
Constructor Detail
-
TestMethod
TestMethod(ReportEntry description, TestSet testSet)
-
-
Method Detail
-
testFinished
void testFinished()
-
testIgnored
void testIgnored(ReportEntry description)
-
testFailure
void testFailure(ReportEntry failure)
-
testError
void testError(ReportEntry failure)
-
testAssumption
void testAssumption(ReportEntry failure)
-
setEndTime
private void setEndTime()
-
getElapsed
int getElapsed()
-
getStartTime
long getStartTime()
-
getEndTime
long getEndTime()
-
replay
void replay(RunListener reporter)
-
createReportEntry
private ReportEntry createReportEntry(ReportEntry reportEntry)
-
attachToThread
void attachToThread()
-
detachFromCurrentThread
void detachFromCurrentThread()
-
getThreadTestMethod
static TestMethod getThreadTestMethod()
-
getLogicalStream
LogicalStream getLogicalStream()
-
writeTestOutput
public void writeTestOutput(java.lang.String output, boolean newLine, boolean stdout)
Description copied from interface:ConsoleOutputReceiver
Forwards process output from the running test-case into the reporting system- Specified by:
writeTestOutput
in interfaceConsoleOutputReceiver
- Parameters:
output
- stdout/sterr output from running testsnewLine
- print on new linestdout
- Indicates if this is stdout
-
getTestSet
TestSet getTestSet()
-
-