|
||||||||||
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:
Steps
class, in which case the instance is the
extended Steps
class itself ("is-a" relationship)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,
Class<?> type,
InjectableStepsFactory stepsFactory)
Creates Steps with given custom configuration and a steps instance type containing the candidate step methods. |
|
Steps(Configuration configuration,
Object instance)
Creates Steps with given custom configuration and a steps instance containing the candidate step methods |
Method Summary | |
---|---|
Configuration |
configuration()
Returns the configuration |
Object |
instance()
|
List<BeforeOrAfterStep> |
listBeforeOrAfterScenario(ScenarioType type)
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()
|
Class<?> |
type()
|
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, Object instance)
configuration
- the Configurationinstance
- the steps instancepublic Steps(Configuration configuration, Class<?> type, InjectableStepsFactory stepsFactory)
configuration
- the Configurationtype
- the steps instance typestepsFactory
- the InjectableStepsFactory
Method Detail |
---|
public Class<?> type()
public Object instance()
public Configuration configuration()
CandidateSteps
configuration
in interface CandidateSteps
public List<StepCandidate> listCandidates()
CandidateSteps
listCandidates
in interface CandidateSteps
public List<BeforeOrAfterStep> listBeforeOrAfterStories()
CandidateSteps
listBeforeOrAfterStories
in interface CandidateSteps
public List<BeforeOrAfterStep> listBeforeOrAfterStory(boolean givenStory)
CandidateSteps
listBeforeOrAfterStory
in interface CandidateSteps
givenStory
- the boolean flag denoting if it's a given story
public List<BeforeOrAfterStep> listBeforeOrAfterScenario(ScenarioType type)
CandidateSteps
listBeforeOrAfterScenario
in interface CandidateSteps
type
- the ScenarioType
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |