|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbehave.core.steps.Steps
public class Steps
Implementation of CandidateSteps
which provides access to the
candidate steps that match the story you want to run.
To provide your candidate steps methods, you can either extend the
Steps
class or pass it any Object
instance that it can wrap.
In the former case, the instance is the extended Steps
class itself.
Both "has-a" relationship and "is-a" design models are thus supported.
You can define the methods that should be run by annotating them with @Given, @When
or @Then, and providing as a value for each annotation a pattern matches the
textual step. The value is interpreted by the StepPatternParser
,
which by default is a RegexPrefixCapturingPatternParser
that
interprets the words starting with '$' as parameters.
For instance, you could define a method as:
Nested Class Summary | |
---|---|
static class |
Steps.DuplicateCandidateStepFoundException
|
Constructor Summary | |
---|---|
Steps()
Creates Steps with default configuration for a class extending this instance and containing the candidate step methods |
|
Steps(Configuration configuration)
Creates Steps with given custom configuration for a class extending this instance and containing the candidate step methods |
|
Steps(Configuration configuration,
java.lang.Object instance)
Creates Steps with given custom configuration wrapping an Object instance containing the candidate step methods |
Method Summary | |
---|---|
Configuration |
configuration()
Returns the configuration |
java.lang.Object |
instance()
|
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterScenario()
Returns the before or after scenario steps |
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterStories()
Returns the before or after stories steps |
java.util.List<BeforeOrAfterStep> |
listBeforeOrAfterStory(boolean givenStory)
Returns the before or after story steps, based on the given story status |
java.util.List<CandidateStep> |
listCandidates()
Returns the candidate steps that can be matched |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Steps()
public Steps(Configuration configuration)
configuration
- the Configurationpublic Steps(Configuration configuration, java.lang.Object instance)
configuration
- the Configurationinstance
- the Object instanceMethod Detail |
---|
public java.lang.Object instance()
public Configuration configuration()
CandidateSteps
configuration
in interface CandidateSteps
public java.util.List<CandidateStep> listCandidates()
CandidateSteps
listCandidates
in interface CandidateSteps
public java.util.List<BeforeOrAfterStep> listBeforeOrAfterStories()
CandidateSteps
listBeforeOrAfterStories
in interface CandidateSteps
public java.util.List<BeforeOrAfterStep> listBeforeOrAfterStory(boolean givenStory)
CandidateSteps
listBeforeOrAfterStory
in interface CandidateSteps
givenStory
- the boolean flag denoting if it's a given story
public java.util.List<BeforeOrAfterStep> listBeforeOrAfterScenario()
CandidateSteps
listBeforeOrAfterScenario
in interface CandidateSteps
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |