Package org.jbehave.core.reporters
Class JsonOutput
- java.lang.Object
-
- org.jbehave.core.reporters.NullStoryReporter
-
- org.jbehave.core.reporters.PrintStreamOutput
-
- org.jbehave.core.reporters.JsonOutput
-
- All Implemented Interfaces:
StoryReporter
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.- Author:
- Valery Yatsynovich
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jbehave.core.reporters.PrintStreamOutput
PrintStreamOutput.Format
-
-
Field Summary
-
Fields inherited from class org.jbehave.core.reporters.PrintStreamOutput
NL
-
-
Constructor Summary
Constructors Constructor Description JsonOutput(PrintStream output, Properties outputPatterns, Keywords keywords)JsonOutput(PrintStream output, Keywords keywords)
-
Method Summary
Modifier and Type Method Description protected Stringformat(String key, String defaultPattern, Object... args)Formats event output by key, usually equal to the method name.protected voidprint(PrintStream output, String text)protected StringtransformPrintingTable(String text, String tableStart, String tableEnd)-
Methods inherited from class org.jbehave.core.reporters.PrintStreamOutput
afterComposedSteps, afterExamples, afterGivenStories, afterScenario, afterScenarios, afterScenarioSteps, afterStoriesSteps, afterStory, afterStorySteps, beforeComposedSteps, beforeExamples, beforeGivenStories, beforeScenario, beforeScenarios, beforeScenarioSteps, beforeStep, beforeStoriesSteps, beforeStory, beforeStorySteps, comment, compressFailureTrace, doCompressFailureTrace, doReportFailureTrace, dryRun, escape, example, failed, failedOutcomes, formatTable, formatVerbatim, givenStories, givenStories, ignorable, lifecycle, lookupPattern, narrative, notPerformed, overwritePattern, pending, print, reportFailureTrace, restarted, restartedStory, scenarioExcluded, storyCancelled, storyExcluded, successful, toString, transformPrintingVerbatim
-
Methods inherited from class org.jbehave.core.reporters.NullStoryReporter
pending, pendingMethods
-
-
-
-
Constructor Detail
-
JsonOutput
public JsonOutput(PrintStream output, Keywords keywords)
-
JsonOutput
public JsonOutput(PrintStream output, Properties outputPatterns, Keywords keywords)
-
-
Method Detail
-
print
protected void print(PrintStream output, String text)
- Overrides:
printin classPrintStreamOutput
-
format
protected String format(String key, String defaultPattern, Object... args)
Description copied from class:PrintStreamOutputFormats event output by key, usually equal to the method name.- Overrides:
formatin classPrintStreamOutput- Parameters:
key- the event keydefaultPattern- the default pattern to return if a custom pattern is not foundargs- the args used to format output- Returns:
- A formatted event output
-
transformPrintingTable
protected String transformPrintingTable(String text, String tableStart, String tableEnd)
- Overrides:
transformPrintingTablein classPrintStreamOutput
-
-