public class ForkingRunListener extends java.lang.Object implements RunListener, ConsoleLogger, ConsoleOutputReceiver
Modifier and Type | Field and Description |
---|---|
static byte |
BOOTERCODE_BYE |
static byte |
BOOTERCODE_CONSOLE |
static byte |
BOOTERCODE_ERROR |
static byte |
BOOTERCODE_NEXT_TEST |
static byte |
BOOTERCODE_STDERR |
static byte |
BOOTERCODE_STDOUT |
static byte |
BOOTERCODE_STOP_ON_NEXT_TEST |
static byte |
BOOTERCODE_SYSPROPS |
static byte |
BOOTERCODE_TEST_ASSUMPTIONFAILURE |
static byte |
BOOTERCODE_TEST_ERROR |
static byte |
BOOTERCODE_TEST_FAILED |
static byte |
BOOTERCODE_TEST_SKIPPED |
static byte |
BOOTERCODE_TEST_STARTING |
static byte |
BOOTERCODE_TEST_SUCCEEDED |
static byte |
BOOTERCODE_TESTSET_COMPLETED |
static byte |
BOOTERCODE_TESTSET_STARTING |
private byte[] |
stdErrHeader |
private byte[] |
stdOutHeader |
private java.io.PrintStream |
target |
private int |
testSetChannelId |
private boolean |
trimStackTraces |
Constructor and Description |
---|
ForkingRunListener(java.io.PrintStream target,
int testSetChannelId,
boolean trimStackTraces) |
Modifier and Type | Method and Description |
---|---|
private ForkingRunListener |
append(java.lang.StringBuilder stringBuilder,
byte b) |
private ForkingRunListener |
append(java.lang.StringBuilder stringBuilder,
java.lang.String message) |
private static void |
comma(java.lang.StringBuilder stringBuilder) |
static byte[] |
createHeader(byte booterCode,
int testSetChannel) |
private java.lang.String |
encode(java.lang.String source) |
private void |
encode(java.lang.StringBuilder stringBuilder,
StackTraceWriter stackTraceWriter) |
static void |
encode(java.lang.StringBuilder stringBuilder,
StackTraceWriter stackTraceWriter,
boolean trimStackTraces) |
private void |
encodeAndWriteToTarget(java.lang.String string) |
void |
info(java.lang.String message) |
private void |
nullableEncoding(java.lang.StringBuilder stringBuilder,
java.lang.Integer source) |
private static void |
nullableEncoding(java.lang.StringBuilder stringBuilder,
java.lang.String source) |
(package private) void |
sendProps() |
void |
testAssumptionFailure(ReportEntry report)
Event fired when a test assumption failure was encountered.
|
void |
testError(ReportEntry report)
Event fired when a test ended with an error (non anticipated problem)
|
void |
testExecutionSkippedByUser()
Event fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks.
|
void |
testFailed(ReportEntry report)
Event fired when a test ended with a failure (anticipated problem)
|
void |
testSetCompleted(ReportEntry report)
Indicates end of a given test-set
|
void |
testSetStarting(ReportEntry report)
Indicates the start of a given test-set
|
void |
testSkipped(ReportEntry report)
Event fired when a test is skipped
|
void |
testStarting(ReportEntry report)
Event fired when a test is about to start
|
void |
testSucceeded(ReportEntry report)
Event fired when a test ended successfully
|
private java.lang.String |
toPropertyString(java.lang.String key,
java.lang.String value) |
private java.lang.String |
toString(byte operationCode,
ReportEntry reportEntry,
int testSetChannelId) |
void |
writeTestOutput(byte[] buf,
int off,
int len,
boolean stdout)
Forwards process output from the running test-case into the reporting system
|
public static final byte BOOTERCODE_TESTSET_STARTING
public static final byte BOOTERCODE_TESTSET_COMPLETED
public static final byte BOOTERCODE_STDOUT
public static final byte BOOTERCODE_STDERR
public static final byte BOOTERCODE_TEST_STARTING
public static final byte BOOTERCODE_TEST_SUCCEEDED
public static final byte BOOTERCODE_TEST_ERROR
public static final byte BOOTERCODE_TEST_FAILED
public static final byte BOOTERCODE_TEST_SKIPPED
public static final byte BOOTERCODE_TEST_ASSUMPTIONFAILURE
public static final byte BOOTERCODE_CONSOLE
public static final byte BOOTERCODE_SYSPROPS
public static final byte BOOTERCODE_NEXT_TEST
public static final byte BOOTERCODE_STOP_ON_NEXT_TEST
public static final byte BOOTERCODE_ERROR
public static final byte BOOTERCODE_BYE
private final java.io.PrintStream target
private final int testSetChannelId
private final boolean trimStackTraces
private final byte[] stdOutHeader
private final byte[] stdErrHeader
public ForkingRunListener(java.io.PrintStream target, int testSetChannelId, boolean trimStackTraces)
public void testSetStarting(ReportEntry report)
RunListener
testSetStarting
in interface RunListener
report
- the report entry describing the testsetpublic void testSetCompleted(ReportEntry report)
RunListener
testSetCompleted
in interface RunListener
report
- the report entry describing the testsetpublic void testStarting(ReportEntry report)
RunListener
testStarting
in interface RunListener
report
- The report entry to log forpublic void testSucceeded(ReportEntry report)
RunListener
testSucceeded
in interface RunListener
report
- The report entry to log forpublic void testAssumptionFailure(ReportEntry report)
RunListener
testAssumptionFailure
in interface RunListener
report
- The report entry to log forpublic void testError(ReportEntry report)
RunListener
testError
in interface RunListener
report
- The report entry to log forpublic void testFailed(ReportEntry report)
RunListener
testFailed
in interface RunListener
report
- The report entry to log forpublic void testSkipped(ReportEntry report)
RunListener
testSkipped
in interface RunListener
report
- The report entry to log forpublic void testExecutionSkippedByUser()
RunListener
SurefireProvider
.(The event is fired after the Nth test failed to signal skipping the rest of test-set.)
testExecutionSkippedByUser
in interface RunListener
void sendProps()
public void writeTestOutput(byte[] buf, int off, int len, boolean stdout)
ConsoleOutputReceiver
writeTestOutput
in interface ConsoleOutputReceiver
buf
- the buffer to writeoff
- offsetlen
- lenstdout
- Indicates if this is stdoutpublic static byte[] createHeader(byte booterCode, int testSetChannel)
public void info(java.lang.String message)
info
in interface ConsoleLogger
private void encodeAndWriteToTarget(java.lang.String string)
private java.lang.String toPropertyString(java.lang.String key, java.lang.String value)
private java.lang.String toString(byte operationCode, ReportEntry reportEntry, int testSetChannelId)
private static void comma(java.lang.StringBuilder stringBuilder)
private ForkingRunListener append(java.lang.StringBuilder stringBuilder, java.lang.String message)
private ForkingRunListener append(java.lang.StringBuilder stringBuilder, byte b)
private void nullableEncoding(java.lang.StringBuilder stringBuilder, java.lang.Integer source)
private java.lang.String encode(java.lang.String source)
private static void nullableEncoding(java.lang.StringBuilder stringBuilder, java.lang.String source)
private void encode(java.lang.StringBuilder stringBuilder, StackTraceWriter stackTraceWriter)
public static void encode(java.lang.StringBuilder stringBuilder, StackTraceWriter stackTraceWriter, boolean trimStackTraces)