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 ReportEntrydescriptionprivate longendTimeprivate java.util.concurrent.atomic.AtomicReference<LogicalStream>outputprivate longstartTimeprivate static java.lang.InheritableThreadLocal<TestMethod>TEST_METHODprivate ReportEntrytestAssumptionprivate ReportEntrytestErrorprivate ReportEntrytestFailureprivate ReportEntrytestIgnoredprivate TestSettestSet
-
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) voidattachToThread()private ReportEntrycreateReportEntry(ReportEntry reportEntry)(package private) voiddetachFromCurrentThread()(package private) intgetElapsed()(package private) longgetEndTime()(package private) LogicalStreamgetLogicalStream()(package private) longgetStartTime()TestSetgetTestSet()(package private) static TestMethodgetThreadTestMethod()(package private) voidreplay(RunListener reporter)private voidsetEndTime()(package private) voidtestAssumption(ReportEntry failure)(package private) voidtestError(ReportEntry failure)(package private) voidtestFailure(ReportEntry failure)(package private) voidtestFinished()(package private) voidtestIgnored(ReportEntry description)voidwriteTestOutput(byte[] buf, int off, int len, 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(byte[] buf, int off, int len, boolean stdout)Description copied from interface:ConsoleOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceConsoleOutputReceiver- Parameters:
buf- the buffer to writeoff- offsetlen- lenstdout- Indicates if this is stdout
-
getTestSet
public TestSet getTestSet()
-
-