Class ConsoleOutputFileReporter
- java.lang.Object
-
- org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter
-
- All Implemented Interfaces:
TestcycleConsoleOutputReceiver,ConsoleOutputReceiver
public class ConsoleOutputFileReporter extends java.lang.Object implements TestcycleConsoleOutputReceiver
Surefire output consumer proxy that writes test output to aFilefor each test suite.
-
-
Field Summary
Fields Modifier and Type Field Description private static intCLOSEDprivate static intCLOSED_TO_REOPENprivate java.util.concurrent.atomic.AtomicStampedReference<java.io.FilterOutputStream>fileOutputStreamprivate java.lang.IntegerforkNumberprivate java.util.concurrent.locks.ReentrantLocklockprivate static intOPENprivate java.lang.StringreportEntryNameprivate java.lang.StringreportNameSuffixprivate java.io.FilereportsDirectoryprivate static intSTREAM_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description ConsoleOutputFileReporter(java.io.File reportsDirectory, java.lang.String reportNameSuffix, java.lang.Integer forkNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidclose(boolean closeReattempt)private voidcloseNullReportFile(ReportEntry reportEntry)private voidcloseReportFile()private voiddumpException(java.io.IOException e)voidtestSetCompleted(ReportEntry report)voidtestSetStarting(ReportEntry reportEntry)voidwriteTestOutput(byte[] buf, int off, int len, boolean stdout)Forwards process output from the running test-case into the reporting system
-
-
-
Field Detail
-
STREAM_BUFFER_SIZE
private static final int STREAM_BUFFER_SIZE
- See Also:
- Constant Field Values
-
OPEN
private static final int OPEN
- See Also:
- Constant Field Values
-
CLOSED_TO_REOPEN
private static final int CLOSED_TO_REOPEN
- See Also:
- Constant Field Values
-
CLOSED
private static final int CLOSED
- See Also:
- Constant Field Values
-
reportsDirectory
private final java.io.File reportsDirectory
-
reportNameSuffix
private final java.lang.String reportNameSuffix
-
forkNumber
private final java.lang.Integer forkNumber
-
fileOutputStream
private final java.util.concurrent.atomic.AtomicStampedReference<java.io.FilterOutputStream> fileOutputStream
-
lock
private final java.util.concurrent.locks.ReentrantLock lock
-
reportEntryName
private volatile java.lang.String reportEntryName
-
-
Method Detail
-
testSetStarting
public void testSetStarting(ReportEntry reportEntry)
- Specified by:
testSetStartingin interfaceTestcycleConsoleOutputReceiver
-
testSetCompleted
public void testSetCompleted(ReportEntry report)
- Specified by:
testSetCompletedin interfaceTestcycleConsoleOutputReceiver
-
close
public void close()
- Specified by:
closein interfaceTestcycleConsoleOutputReceiver
-
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
-
closeNullReportFile
private void closeNullReportFile(ReportEntry reportEntry)
-
closeReportFile
private void closeReportFile()
-
close
private void close(boolean closeReattempt) throws java.io.IOException- Throws:
java.io.IOException
-
dumpException
private void dumpException(java.io.IOException e)
-
-