Class ConsoleOutputFileReporter
- java.lang.Object
-
- org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter
-
- All Implemented Interfaces:
TestcycleConsoleOutputReceiver,ConsoleOutputReportEventListener,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.lang.Stringencodingprivate 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_SIZEprivate booleanusePhrasedFileName
-
Constructor Summary
Constructors Constructor Description ConsoleOutputFileReporter(java.io.File reportsDirectory, java.lang.String reportNameSuffix, boolean usePhrasedFileName, java.lang.Integer forkNumber, java.lang.String encoding)
-
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(TestSetReportEntry report)voidtestSetStarting(TestSetReportEntry reportEntry)voidwriteTestOutput(java.lang.String output, boolean newLine, 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
-
usePhrasedFileName
private final boolean usePhrasedFileName
-
forkNumber
private final java.lang.Integer forkNumber
-
encoding
private final java.lang.String encoding
-
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(TestSetReportEntry reportEntry)
- Specified by:
testSetStartingin interfaceConsoleOutputReportEventListener- Specified by:
testSetStartingin interfaceTestcycleConsoleOutputReceiver
-
testSetCompleted
public void testSetCompleted(TestSetReportEntry report)
- Specified by:
testSetCompletedin interfaceConsoleOutputReportEventListener- Specified by:
testSetCompletedin interfaceTestcycleConsoleOutputReceiver
-
close
public void close()
- Specified by:
closein interfaceConsoleOutputReportEventListener- Specified by:
closein interfaceTestcycleConsoleOutputReceiver
-
writeTestOutput
public void writeTestOutput(java.lang.String output, boolean newLine, boolean stdout)Description copied from interface:ConsoleOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceConsoleOutputReceiver- Specified by:
writeTestOutputin interfaceConsoleOutputReportEventListener- Parameters:
output- stdout/sterr output from running testsnewLine- print on new linestdout- 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)
-
-