|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgherkin.formatter.PrettyFormatter
public class PrettyFormatter
This class pretty prints feature files like they were in the source, only
prettier. That is, with consistent indentation. This class is also a Reporter,
which means it can be used to print execution results - highlighting arguments,
printing source information and exception information.
| Constructor Summary | |
|---|---|
PrettyFormatter(Appendable out,
boolean monochrome,
boolean executing)
|
|
| Method Summary | |
|---|---|
void |
after(Match match,
Result result)
|
void |
background(Background background)
Called before the actual execution of the background step container. |
void |
before(Match match,
Result result)
|
void |
close()
Closes all underlying streams. |
void |
docString(DocString docString)
|
void |
done()
Indicates that the last file has been processed. |
void |
embedding(String mimeType,
byte[] data)
|
void |
endOfScenarioLifeCycle(Scenario scenario)
Is called at the end of the scenario life cycle, meaning after the last "after" hook. |
void |
eof()
Indicates the End-Of-File for a Gherkin document (.feature file) |
void |
examples(Examples examples)
Called before the actual execution of the scenario examples. |
void |
feature(Feature feature)
Called after the Formatter.uri(String), but before the actual feature execution. |
void |
match(Match match)
|
void |
nextRow()
|
void |
result(Result result)
|
void |
row(List<CellResult> cellResults)
|
void |
scenario(Scenario scenario)
Called before the actual execution of the scenario step container. |
void |
scenarioOutline(ScenarioOutline scenarioOutline)
Called before the actual execution of the scenario outline step container. |
void |
setMonochrome(boolean monochrome)
|
void |
startOfScenarioLifeCycle(Scenario scenario)
Is called at the beginning of the scenario life cycle, meaning before the first "before" hook. |
void |
step(Step step)
Is called for each step of a step container. |
void |
syntaxError(String state,
String event,
List<String> legalEvents,
String uri,
Integer line)
Is called in case any syntax error was detected during the parsing of the feature files. |
void |
table(List<? extends Row> rows)
|
void |
uri(String uri)
Called at the beginning of each feature. |
void |
write(String text)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PrettyFormatter(Appendable out,
boolean monochrome,
boolean executing)
| Method Detail |
|---|
public void setMonochrome(boolean monochrome)
public void uri(String uri)
Formatter
uri in interface Formatteruri - the feature's URIpublic void feature(Feature feature)
FormatterFormatter.uri(String), but before the actual feature execution.
feature in interface Formatterfeature - the to be executed Featurepublic void background(Background background)
Formatter
background in interface Formatterbackground - the to be executed Backgroundpublic void scenario(Scenario scenario)
Formatter
scenario in interface Formatterscenario - the to be executed Scenariopublic void scenarioOutline(ScenarioOutline scenarioOutline)
Formatter
scenarioOutline in interface FormatterscenarioOutline - the to be executed ScenarioOutlinepublic void startOfScenarioLifeCycle(Scenario scenario)
Formatter
startOfScenarioLifeCycle in interface Formatterscenario - the Scenario of the current lifecyclepublic void endOfScenarioLifeCycle(Scenario scenario)
FormatterScenario of the current lifecycle
endOfScenarioLifeCycle in interface Formatterpublic void examples(Examples examples)
FormatterFormatter.scenarioOutline(gherkin.formatter.model.ScenarioOutline),
but before any actual scenario example.
examples in interface Formatterexamples - the to be executedpublic void step(Step step)
Formatter
step in interface Formatterstep - the Step to be executedpublic void match(Match match)
match in interface Reporter
public void embedding(String mimeType,
byte[] data)
embedding in interface Reporterpublic void write(String text)
write in interface Reporterpublic void result(Result result)
result in interface Reporter
public void before(Match match,
Result result)
before in interface Reporter
public void after(Match match,
Result result)
after in interface Reporterpublic void table(List<? extends Row> rows)
public void row(List<CellResult> cellResults)
public void nextRow()
public void syntaxError(String state,
String event,
List<String> legalEvents,
String uri,
Integer line)
Formatter
syntaxError in interface Formatterstate - the current state of the parser machineevent - detected eventlegalEvents - expected eventuri - the URI of the feature fileline - the line number of the eventpublic void done()
Formatter
done in interface Formatterpublic void close()
Formatter
close in interface Formatterclose in interface Closeablepublic void docString(DocString docString)
public void eof()
Formatter
eof in interface Formatter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||