public class RegexStoryParserExtended
extends org.jbehave.core.parsers.RegexStoryParser
RegexStoryParser: the comments shouldn't be added to the description.| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
LOGGER |
| Constructor and Description |
|---|
RegexStoryParserExtended() |
RegexStoryParserExtended(org.jbehave.core.model.ExamplesTableFactory tableFactory) |
RegexStoryParserExtended(org.jbehave.core.configuration.Keywords keywords) |
RegexStoryParserExtended(org.jbehave.core.configuration.Keywords keywords,
org.jbehave.core.model.ExamplesTableFactory tableFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
concatenateWithOr(String... keywords)
concatenate the keywords with an | in between, f.e.: keyword1|keyword2|keyword3 .
|
protected String |
concatenateWithOr(String beforeKeyword,
String afterKeyword,
String[] keywords)
concatenate the keywords with an | in between, f.e.: before keyword1 after|before keyword2 after|before keyword3 after.
|
protected org.jbehave.core.model.Narrative |
createNarrative(String narrative)
This method pulls the narrative out of the story text.
|
protected org.jbehave.core.model.ExamplesTable |
findExamplesTable(String scenarioAsText)
This method finds the
ExamplesTable out of the story text. |
protected String |
findOutcome(String stepsByOutcome)
This method looks for the outcome of a step.
|
protected org.jbehave.core.model.GivenStories |
findScenarioGivenStories(String scenarioAsText)
This method finds all the
GivenStories out of the story text. |
protected org.jbehave.core.model.Meta |
findScenarioMeta(String scenarioAsText)
This method looks for the
Meta data in the store text. |
protected String |
findScenarioTitle(String scenarioAsText)
This method looks for the scenario title in the story text.
|
protected List<String> |
findSteps(String stepsAsText)
This method gets all the different steps out of the story text.
|
protected org.jbehave.core.model.Lifecycle.Steps[] |
parseAfterLifecycle(String lifecycleAsText)
This method parses all the steps after the
Keywords.lifecycle() in the story text. |
protected org.jbehave.core.model.Lifecycle.Steps |
parseBeforeLifecycle(String lifecycleAsText)
parses the steps before the lifecycle.
|
protected org.jbehave.core.model.Description |
parseDescriptionFrom(String storyAsText)
Parse the entire
Description out of the story text. |
protected org.jbehave.core.model.GivenStories |
parseGivenStories(String storyAsText)
Gets all the
GivenStories out of the story text. |
protected org.jbehave.core.model.Lifecycle |
parseLifecycle(String storyAsText)
Parses the
Lifecycle out of the story text. |
protected org.jbehave.core.model.Narrative |
parseNarrativeFrom(String storyAsText)
This method pulls the
Narrative out of the story text. |
protected org.jbehave.core.annotations.AfterScenario.Outcome |
parseOutcome(String outcomeAsText)
This method parses the outcome out of the story text.
|
protected org.jbehave.core.model.Scenario |
parseScenario(String scenarioAsText)
This method pulls the entire
Scenario out of the story text. |
protected List<org.jbehave.core.model.Scenario> |
parseScenariosFrom(String storyAsText)
This method parses the story text in diffenent
Scenarios. |
org.jbehave.core.model.Story |
parseStory(String storyAsText,
String storyPath) |
protected org.jbehave.core.model.Meta |
parseStoryMetaFrom(String storyAsText)
This method parses all the meta data from the story text.
|
protected Pattern |
patternToPullAlternativeNarrativeElementsIntoGroups()
Creates a regex pattern to get all the alternative
Narratives out of the story text. |
protected Pattern |
patternToPullDescriptionIntoGroupOne()
This method creates a regex
Pattern to get the description out of Meta, Narrative, Lifecycle,
Scenarios. |
protected Pattern |
patternToPullExamplesTableIntoGroupOne()
create a regex pattern to look for the
ExamplesTable. |
protected Pattern |
patternToPullLifecycleIntoGroupOne()
This method creates the regex expression to pull the
Lifecycle out of the story text. |
protected Pattern |
patternToPullLifecycleOutcomeIntoGroupOne()
This method creates the regex pattern to get the lifecycle out of the story text.
|
protected Pattern |
patternToPullNarrativeElementsIntoGroups()
Creates a regex pattern to get all the
Narratives out of the story text. |
protected Pattern |
patternToPullNarrativeIntoGroupOne()
Creates a regex
Pattern to get all the Narratives out of the first group. |
protected Pattern |
patternToPullScenarioGivenStoriesIntoGroupOne()
Create a regex pattern to get the
Keywords.givenStories() out of the story text. |
protected Pattern |
patternToPullScenarioMetaIntoGroupOne()
Create a regex pattern to get all the
Meta information out of the story text. |
protected Pattern |
patternToPullScenarioTitleIntoGroupOne()
Creates a regex pattern to get the scenario title out of the story text.
|
protected Pattern |
patternToPullStepsIntoGroupOne()
We removed the
Keywords.ignorable() keyword out of the list. |
protected Pattern |
patternToPullStoryGivenStoriesIntoGroupOne()
This method is used to create the regex pattern to parse the
GivenStories out of the story text. |
protected Pattern |
patternToPullStoryMetaIntoGroupOne()
create a regex
Pattern to get the Meta data out of the story text. |
protected String |
preScenarioText(String storyAsText)
Get the pre-scenario text out of the story text.
|
protected List<String> |
splitScenarios(String storyAsText)
This methods looks for the word
Keywords.scenario() in the story text and splits the story text up in diffent strings (the
scenarios). |
protected String |
startingWithNL(String text)
ensure that the text starts on a new line.
|
public RegexStoryParserExtended()
public RegexStoryParserExtended(org.jbehave.core.model.ExamplesTableFactory tableFactory)
tableFactory - : the factory that creates the ExamplesTable.public RegexStoryParserExtended(org.jbehave.core.configuration.Keywords keywords)
keywords - : the Keywords used by JBehave.public RegexStoryParserExtended(org.jbehave.core.configuration.Keywords keywords,
org.jbehave.core.model.ExamplesTableFactory tableFactory)
keywords - : the Keywords used by JBehave.tableFactory - : the factory that creates the ExamplesTable.public org.jbehave.core.model.Story parseStory(String storyAsText, String storyPath)
parseStory in interface org.jbehave.core.parsers.StoryParserparseStory in class org.jbehave.core.parsers.RegexStoryParserstoryAsText - : the entire story as textstoryPath - : the path of the storyStoryRegexStoryParser.parseStory(java.lang.String, java.lang.String)protected org.jbehave.core.model.Description parseDescriptionFrom(String storyAsText)
Description out of the story text.storyAsText - : the entire story as text.Descriptionprotected org.jbehave.core.model.Meta parseStoryMetaFrom(String storyAsText)
storyAsText - : the entire story as text.Metaprotected String preScenarioText(String storyAsText)
storyAsText - : the entire story as text.Stringprotected org.jbehave.core.model.Narrative parseNarrativeFrom(String storyAsText)
Narrative out of the story text.storyAsText - : the entire story as text.Narrativeprotected org.jbehave.core.model.Narrative createNarrative(String narrative)
narrative - : the narrative as plain text.Narrativeprotected org.jbehave.core.model.GivenStories parseGivenStories(String storyAsText)
GivenStories out of the story text.storyAsText - : the entire story as text.GivenStoriesprotected org.jbehave.core.model.Lifecycle parseLifecycle(String storyAsText)
Lifecycle out of the story text.storyAsText - : the entire story as text.Lifecycleprotected org.jbehave.core.model.Lifecycle.Steps parseBeforeLifecycle(String lifecycleAsText)
lifecycleAsText - : the entire lifecycle as text.Lifecycle.Stepsprotected org.jbehave.core.model.Lifecycle.Steps[] parseAfterLifecycle(String lifecycleAsText)
Keywords.lifecycle() in the story text.lifecycleAsText - : the entire lifecycle as text.Arrayprotected org.jbehave.core.annotations.AfterScenario.Outcome parseOutcome(String outcomeAsText)
outcomeAsText - : the outcome as plain text.AfterScenario.Outcomeprotected String findOutcome(String stepsByOutcome)
stepsByOutcome - : all the steps by outcome.Stringprotected List<org.jbehave.core.model.Scenario> parseScenariosFrom(String storyAsText)
Scenarios.storyAsText - : the entire story as text.Listprotected List<String> splitScenarios(String storyAsText)
Keywords.scenario() in the story text and splits the story text up in diffent strings (the
scenarios).storyAsText - : the entire story as text.Listprotected org.jbehave.core.model.Scenario parseScenario(String scenarioAsText)
Scenario out of the story text.scenarioAsText - : the entire scenario as plain text.Scenarioprotected String startingWithNL(String text)
text - : the text that needs to be checkedStringprotected String findScenarioTitle(String scenarioAsText)
scenarioAsText - : the entire scenario as plain text.Stringprotected org.jbehave.core.model.Meta findScenarioMeta(String scenarioAsText)
Meta data in the store text.scenarioAsText - : the entire scenario as plain text.Metaprotected org.jbehave.core.model.ExamplesTable findExamplesTable(String scenarioAsText)
ExamplesTable out of the story text.scenarioAsText - : the entire scenario as plain text.ExamplesTableprotected org.jbehave.core.model.GivenStories findScenarioGivenStories(String scenarioAsText)
GivenStories out of the story text.scenarioAsText - : the entire scenario as plain text.GivenStoriesprotected List<String> findSteps(String stepsAsText)
protected Pattern patternToPullDescriptionIntoGroupOne()
Pattern to get the description out of Meta, Narrative, Lifecycle,
Scenarios.Patternprotected Pattern patternToPullStoryMetaIntoGroupOne()
Pattern to get the Meta data out of the story text.Patternprotected Pattern patternToPullNarrativeIntoGroupOne()
Pattern to get all the Narratives out of the first group.Patternprotected Pattern patternToPullNarrativeElementsIntoGroups()
Narratives out of the story text.protected Pattern patternToPullAlternativeNarrativeElementsIntoGroups()
Narratives out of the story text.protected Pattern patternToPullStoryGivenStoriesIntoGroupOne()
GivenStories out of the story text.Patternprotected Pattern patternToPullLifecycleIntoGroupOne()
Lifecycle out of the story text.Patternprotected Pattern patternToPullLifecycleOutcomeIntoGroupOne()
Patternprotected Pattern patternToPullScenarioTitleIntoGroupOne()
Patternprotected Pattern patternToPullScenarioMetaIntoGroupOne()
Meta information out of the story text.Patternprotected Pattern patternToPullScenarioGivenStoriesIntoGroupOne()
Keywords.givenStories() out of the story text.Patternprotected Pattern patternToPullStepsIntoGroupOne()
Keywords.ignorable() keyword out of the list. In the original code JBehave will put all the comments in the
Description. And this is something that we don't want.Patternprotected Pattern patternToPullExamplesTableIntoGroupOne()
ExamplesTable.Patternprotected String concatenateWithOr(String... keywords)
keywords - : the strings that needs to be concatenated.Stringprotected String concatenateWithOr(String beforeKeyword, String afterKeyword, String[] keywords)
beforeKeyword - : the keyword that should be appended before each element of the param keywords.afterKeyword - : the keyword that should be appended after each element of the param keywords.keywords - : the Keywords used by JBehave.StringCopyright © 2015. All Rights Reserved.