Class MessagesToJunitXmlWriter

java.lang.Object
io.cucumber.junitxmlformatter.MessagesToJunitXmlWriter
All Implemented Interfaces:
AutoCloseable

public final class MessagesToJunitXmlWriter extends Object implements AutoCloseable
Writes the message output of a test run as single page xml report.

Note: Messages are first collected and only written once the stream is closed.

See Also:
  • Constructor Details

    • MessagesToJunitXmlWriter

      public MessagesToJunitXmlWriter(OutputStream out)
    • MessagesToJunitXmlWriter

      public MessagesToJunitXmlWriter(io.cucumber.query.NamingStrategy.ExampleName exampleNameStrategy, OutputStream out)
  • Method Details

    • write

      public void write(io.cucumber.messages.types.Envelope envelope) throws IOException
      Writes a cucumber message to the xml output.
      Parameters:
      envelope - the message
      Throws:
      IOException - if an IO error occurs
    • close

      public void close() throws IOException
      Closes 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:
      close in interface AutoCloseable
      Throws:
      IOException - if an IO error occurs