public class JsonOutput extends PrintStreamOutput
Story reporter that outputs to a PrintStream, as JSON. It extends
PrintStreamOutput
, providing JSON-based default output
patterns, which can be overridden via the (PrintStream,Properties)
constructor.
PrintStreamOutput.Format
Constructor and Description |
---|
JsonOutput(PrintStream output,
Keywords keywords) |
JsonOutput(PrintStream output,
Properties outputPatterns,
Keywords keywords) |
Modifier and Type | Method and Description |
---|---|
protected String |
format(String key,
String defaultPattern,
Object... args)
Formats event output by key, usually equal to the method name.
|
protected void |
print(PrintStream output,
String text) |
protected String |
transformPrintingTable(String text,
String tableStart,
String tableEnd) |
afterExamples, afterGivenStories, afterScenario, afterStory, beforeExamples, beforeGivenStories, beforeScenario, beforeStep, beforeStory, comment, compressFailureTrace, doCompressFailureTrace, doReportFailureTrace, dryRun, escape, example, failed, failedOutcomes, formatTable, givenStories, givenStories, ignorable, lifecyle, lookupPattern, narrative, notPerformed, overwritePattern, pending, pendingMethods, print, reportFailureTrace, restarted, restartedStory, scenarioMeta, scenarioNotAllowed, storyCancelled, storyNotAllowed, successful, toString
public JsonOutput(PrintStream output, Keywords keywords)
public JsonOutput(PrintStream output, Properties outputPatterns, Keywords keywords)
protected void print(PrintStream output, String text)
print
in class PrintStreamOutput
protected String format(String key, String defaultPattern, Object... args)
PrintStreamOutput
format
in class PrintStreamOutput
key
- the event keydefaultPattern
- the default pattern to return if a custom pattern
is not foundargs
- the args used to format outputprotected String transformPrintingTable(String text, String tableStart, String tableEnd)
transformPrintingTable
in class PrintStreamOutput
Copyright © 2003–2018. All rights reserved.