Class ParseTreeVisitorPrinter
java.lang.Object
dev.galasa.framework.spi.language.gherkin.xform.ParseTreeVisitorBase
dev.galasa.framework.spi.language.gherkin.xform.ParseTreeVisitorPrinter
- All Implemented Interfaces:
ParseTreeVisitor
A visitor of the parse tree which can turn an entire parse tree into a single string,
for easy output or comparing against test data.
Each nested level of children is indented by a few spaces so it looks like an acual
hierarchy of some sort.
For example: This gherkin feature:
Feature: GherkinLog
Scenario Outline: Log Example Statement
THEN Write to log "This is a log the item: - "
THEN Write to log "Log the value:
"
Examples:
| Item | Cost |
| apple | 89 |
| pineapple | 339 |
Will render into something like this:
{token:, line:1, text:GherkinLog}
{token:Feature:, line:1, text:GherkinLog}
{token:, line:2, text:Log Example Statement}
{token:, line:2, text:Log Example Statement}
{token:, line:2, text:Log Example Statement}
{token:Scenario Outline:, line:2, text:Log Example Statement}
{token:, line:4, text:THEN Write to log "This is a log the item: - "}
{token:step, line:4, text:THEN Write to log "This is a log the item:
- "}
{token:
, line:5, text:THEN Write to log "Log the value: "}
{token:step, line:5, text:THEN Write to log "Log the value: "}
{token:, line:7, text:}
{token:Examples:, line:7, text:}
{token:, line:8, text:| Item | Cost |}
{token:, line:8, text:| Item | Cost |}
{token:data line, line:8, text:| Item | Cost |}
{token:, line:9, text:| apple | 89 |}
{token:data line, line:9, text:| apple | 89 |}
{token:, line:10, text:| pineapple | 339 |}
{token:data line, line:10, text:| pineapple | 339 |}
{token:, line:0, text:}
{token:, line:11, text:}
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
postVisit
(ParseToken token) void
preVisit
(ParseToken token) void
visit
(ParseToken token) void
visitFeature
(ParseToken token) Methods inherited from class dev.galasa.framework.spi.language.gherkin.xform.ParseTreeVisitorBase
postVisitDataLine, postVisitDataTable, postVisitDataTableHeader, postVisitDataTableLineList, postVisitEndOfFile, postVisitExamplesStart, postVisitFeature, postVisitFeatureStart, postVisitScenario, postVisitScenarioOutline, postVisitScenarioOutlineStart, postVisitScenarioPart, postVisitScenarioPartList, postVisitScenarioStart, postVisitStep, postVisitStepList, preVisitDataLine, preVisitDataTable, preVisitDataTableHeader, preVisitDataTableLineList, preVisitEndOfFile, preVisitExamplesStart, preVisitFeature, preVisitFeatureStart, preVisitScenario, preVisitScenarioOutline, preVisitScenarioOutlineStart, preVisitScenarioPart, preVisitScenarioPartList, preVisitScenarioStart, preVisitStep, preVisitStepList, visitDataLine, visitDataTable, visitDataTableHeader, visitDataTableLineList, visitEndOfFile, visitExamplesStart, visitFeatureStart, visitScenario, visitScenarioOutline, visitScenarioOutlineStart, visitScenarioPart, visitScenarioPartList, visitScenarioStart, visitStep, visitStepList
-
Constructor Details
-
ParseTreeVisitorPrinter
public ParseTreeVisitorPrinter()
-
-
Method Details
-
getResults
-
visit
- Specified by:
visit
in interfaceParseTreeVisitor
- Overrides:
visit
in classParseTreeVisitorBase
- Throws:
TestRunException
-
visitFeature
- Specified by:
visitFeature
in interfaceParseTreeVisitor
- Overrides:
visitFeature
in classParseTreeVisitorBase
- Throws:
TestRunException
-
postVisit
- Specified by:
postVisit
in interfaceParseTreeVisitor
- Overrides:
postVisit
in classParseTreeVisitorBase
-
preVisit
- Specified by:
preVisit
in interfaceParseTreeVisitor
- Overrides:
preVisit
in classParseTreeVisitorBase
-