Package org.apache.maven.surefire.stream
Class EventDecoder
java.lang.Object
org.apache.maven.surefire.api.stream.AbstractStreamDecoder<Event,ForkedProcessEventType,SegmentType>
org.apache.maven.surefire.stream.EventDecoder
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder
AbstractStreamDecoder.BufferedStream, AbstractStreamDecoder.MalformedFrameException, AbstractStreamDecoder.Memento, AbstractStreamDecoder.Segment, AbstractStreamDecoder.StreamReadStatus
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final OutputStream
private static final SegmentType[]
private static final Map<AbstractStreamDecoder.Segment,
ForkedProcessEventType> private static final SegmentType[]
private static final SegmentType[]
private static final SegmentType[]
private static final SegmentType[]
private static final SegmentType[]
private static final int
private static final Map<AbstractStreamDecoder.Segment,
RunMode> Fields inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder
BUFFER_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
debugStream
(byte[] array, int position, int remaining) protected final byte[]
private OutputStream
newDebugSink
(ForkNodeArguments arguments) (package private) static TestSetReportEntry
newReportEntry
(RunMode runMode, long testRunId, String source, String sourceText, String name, String nameText, String group, String message, Integer timeElapsed, String traceMessage, String smartTrimmedStackTrace, String stackTrace) protected final SegmentType[]
nextSegmentType
(ForkedProcessEventType eventType) private static Map<AbstractStreamDecoder.Segment,
ForkedProcessEventType> private static Map<AbstractStreamDecoder.Segment,
RunMode> protected final Event
toMessage
(ForkedProcessEventType eventType, AbstractStreamDecoder<Event, ForkedProcessEventType, SegmentType>.Memento memento) private static TestSetReportEntry
toReportEntry
(List<Object> args) private static StackTraceWriter
toStackTraceWriter
(List<Object> args) private static StackTraceWriter
Methods inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder
checkArguments, checkDelimiter, checkHeader, getArguments, printRemainingStream, read, readByte, readCharset, readInt, readInteger, readLong, readLongPrivate, readMessageType, readSegment, readString
-
Field Details
-
DEBUG_SINK_BUFFER_SIZE
private static final int DEBUG_SINK_BUFFER_SIZE- See Also:
-
EVENT_TYPES
-
RUN_MODES
-
EVENT_WITHOUT_DATA
-
EVENT_WITH_ERROR_TRACE
-
EVENT_WITH_ONE_STRING
-
EVENT_WITH_RUNMODE_TID_AND_ONE_STRING
-
EVENT_WITH_RUNMODE_TID_AND_TWO_STRINGS
-
EVENT_TEST_CONTROL
-
NO_POSITION
private static final int NO_POSITION- See Also:
-
debugSink
-
-
Constructor Details
-
EventDecoder
-
-
Method Details
-
decode
public Event decode(@Nonnull AbstractStreamDecoder<Event, ForkedProcessEventType, throws IOExceptionSegmentType>.Memento memento) - Specified by:
decode
in classAbstractStreamDecoder<Event,
ForkedProcessEventType, SegmentType> - Throws:
IOException
-
getEncodedMagicNumber
@Nonnull protected final byte[] getEncodedMagicNumber()- Specified by:
getEncodedMagicNumber
in classAbstractStreamDecoder<Event,
ForkedProcessEventType, SegmentType>
-
nextSegmentType
- Specified by:
nextSegmentType
in classAbstractStreamDecoder<Event,
ForkedProcessEventType, SegmentType>
-
toMessage
@Nonnull protected final Event toMessage(@Nonnull ForkedProcessEventType eventType, @Nonnull AbstractStreamDecoder<Event, ForkedProcessEventType, throws AbstractStreamDecoder.MalformedFrameExceptionSegmentType>.Memento memento) - Specified by:
toMessage
in classAbstractStreamDecoder<Event,
ForkedProcessEventType, SegmentType> - Throws:
AbstractStreamDecoder.MalformedFrameException
-
toReportEntry
-
toStackTraceWriter
-
toTrace
private static StackTraceWriter toTrace(String traceMessage, String smartTrimmedStackTrace, String stackTrace) -
newReportEntry
static TestSetReportEntry newReportEntry(RunMode runMode, long testRunId, String source, String sourceText, String name, String nameText, String group, String message, Integer timeElapsed, String traceMessage, String smartTrimmedStackTrace, String stackTrace) throws NumberFormatException - Throws:
NumberFormatException
-
segmentsToEvents
-
segmentsToRunModes
-
debugStream
protected void debugStream(byte[] array, int position, int remaining) - Overrides:
debugStream
in classAbstractStreamDecoder<Event,
ForkedProcessEventType, SegmentType>
-
newDebugSink
-
close
- Throws:
IOException
-