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 aFile
for each test suite.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
CLOSED
private static int
CLOSED_TO_REOPEN
private java.util.concurrent.atomic.AtomicStampedReference<java.io.FilterOutputStream>
fileOutputStream
private java.util.concurrent.locks.ReentrantLock
lock
private static int
OPEN
private java.lang.String
reportEntryName
private java.lang.String
reportNameSuffix
private java.io.File
reportsDirectory
private static int
STREAM_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description ConsoleOutputFileReporter(java.io.File reportsDirectory, java.lang.String reportNameSuffix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private void
close(boolean closeReattempt)
private void
closeNullReportFile(ReportEntry reportEntry)
private void
closeReportFile()
void
testSetCompleted(ReportEntry report)
void
testSetStarting(ReportEntry reportEntry)
void
writeTestOutput(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
-
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:
testSetStarting
in interfaceTestcycleConsoleOutputReceiver
-
testSetCompleted
public void testSetCompleted(ReportEntry report)
- Specified by:
testSetCompleted
in interfaceTestcycleConsoleOutputReceiver
-
close
public void close()
- Specified by:
close
in interfaceTestcycleConsoleOutputReceiver
-
writeTestOutput
public void writeTestOutput(byte[] buf, int off, int len, 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:
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
-
-