Package io.cucumber.jsonformatter
Class MessagesToJsonWriter
- java.lang.Object
-
- io.cucumber.jsonformatter.MessagesToJsonWriter
-
- All Implemented Interfaces:
AutoCloseable
public final class MessagesToJsonWriter extends Object implements AutoCloseable
Writes the message output of a test run as single json report.Note: Messages are first collected and only written once the stream is closed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMessagesToJsonWriter.Builderstatic interfaceMessagesToJsonWriter.Serializer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessagesToJsonWriter.Builderbuilder(MessagesToJsonWriter.Serializer serializer)voidclose()Closes the stream, flushing it first.voidwrite(io.cucumber.messages.types.Envelope envelope)Writes a cucumber message to the xml output.
-
-
-
Method Detail
-
builder
public static MessagesToJsonWriter.Builder builder(MessagesToJsonWriter.Serializer serializer)
-
write
public void write(io.cucumber.messages.types.Envelope envelope) throws IOExceptionWrites a cucumber message to the xml output.- Parameters:
envelope- the message- Throws:
IOException- if an IO error occurs
-
close
public void close() throws IOExceptionCloses the stream, flushing it first. Once closed further write() invocations will cause an IOException to be thrown. Closing a closed stream has no effect.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if an IO error occurs
-
-