Package io.cucumber.htmlformatter
Class MessagesToHtmlWriter
- java.lang.Object
-
- io.cucumber.htmlformatter.MessagesToHtmlWriter
-
- All Implemented Interfaces:
AutoCloseable
public final class MessagesToHtmlWriter extends Object implements AutoCloseable
Writes the message output of a test run as single page html report.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMessagesToHtmlWriter.Builderstatic interfaceMessagesToHtmlWriter.SerializerSerializes a message to JSON.
-
Constructor Summary
Constructors Constructor Description MessagesToHtmlWriter(OutputStream outputStream, MessagesToHtmlWriter.Serializer serializer)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessagesToHtmlWriter.Builderbuilder(MessagesToHtmlWriter.Serializer serializer)Creates a builder to construct this writer.voidclose()Closes the stream, flushing it first.voidwrite(io.cucumber.messages.types.Envelope envelope)Writes a cucumber message to the html output.
-
-
-
Constructor Detail
-
MessagesToHtmlWriter
@Deprecated public MessagesToHtmlWriter(OutputStream outputStream, MessagesToHtmlWriter.Serializer serializer) throws IOException
Deprecated.- Throws:
IOException
-
-
Method Detail
-
write
public void write(io.cucumber.messages.types.Envelope envelope) throws IOExceptionWrites a cucumber message to the html 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
-
builder
public static MessagesToHtmlWriter.Builder builder(MessagesToHtmlWriter.Serializer serializer)
Creates a builder to construct this writer.- Parameters:
serializer- used to convert messages into json.- Returns:
- a new builder
-
-