|
||||||||||
| 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
Default implementation of CandidateSteps which provides the step
candidates that match the steps being run.
To provide your step candidate methods, you can either pass it any
Object instance that it can wrap ("has-a" relationship) or extend the
Steps class ("is-a" relationship), in which case the instance is the
extended Steps class itself. The "has-a" design model is strongly
recommended as it does not have tie-ins in the Steps class
implementation.
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.DuplicateCandidateFound
|
| 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,
Object instance)
Creates Steps with given custom configuration wrapping an Object instance containing the candidate step methods |
|
| Method Summary | |
|---|---|
Configuration |
configuration()
Returns the configuration |
Object |
instance()
|
List<BeforeOrAfterStep> |
listBeforeOrAfterScenario()
Returns the before or after scenario steps |
List<BeforeOrAfterStep> |
listBeforeOrAfterStories()
Returns the before or after stories steps |
List<BeforeOrAfterStep> |
listBeforeOrAfterStory(boolean givenStory)
Returns the before or after story steps, based on the given story status |
List<StepCandidate> |
listCandidates()
Returns the step candidates that can be matched |
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 Configuration
public Steps(Configuration configuration,
Object instance)
configuration - the Configurationinstance - the Object instance| Method Detail |
|---|
public Object instance()
public Configuration configuration()
CandidateSteps
configuration in interface CandidateStepspublic List<StepCandidate> listCandidates()
CandidateSteps
listCandidates in interface CandidateStepspublic List<BeforeOrAfterStep> listBeforeOrAfterStories()
CandidateSteps
listBeforeOrAfterStories in interface CandidateStepspublic List<BeforeOrAfterStep> listBeforeOrAfterStory(boolean givenStory)
CandidateSteps
listBeforeOrAfterStory in interface CandidateStepsgivenStory - the boolean flag denoting if it's a given story
public List<BeforeOrAfterStep> listBeforeOrAfterScenario()
CandidateSteps
listBeforeOrAfterScenario in interface CandidateStepspublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||