Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
StepCollector |
|
| 1.0;1 | ||||
StepCollector$Stage |
|
| 1.0;1 |
1 | package org.jbehave.core.steps; | |
2 | ||
3 | import java.util.List; | |
4 | import java.util.Map; | |
5 | ||
6 | import org.jbehave.core.annotations.AfterScenario; | |
7 | import org.jbehave.core.annotations.AfterStories; | |
8 | import org.jbehave.core.annotations.AfterStory; | |
9 | import org.jbehave.core.annotations.BeforeScenario; | |
10 | import org.jbehave.core.annotations.BeforeStories; | |
11 | import org.jbehave.core.annotations.BeforeStory; | |
12 | import org.jbehave.core.annotations.ScenarioType; | |
13 | import org.jbehave.core.model.Meta; | |
14 | import org.jbehave.core.model.Scenario; | |
15 | import org.jbehave.core.model.Story; | |
16 | ||
17 | /** | |
18 | * Represents the strategy for the collection of executable {@link Step}s from a | |
19 | * story or scenario matching a list of {@link CandidateSteps}. It also collects the | |
20 | * steps to run at before/after stages. | |
21 | */ | |
22 | public interface StepCollector { | |
23 | 3 | enum Stage { |
24 | 1 | BEFORE, AFTER |
25 | } | |
26 | ||
27 | /** | |
28 | * Collects all of the {@link BeforeStories} or {@link AfterStories} steps to execute. | |
29 | * | |
30 | * @param candidateSteps | |
31 | * @param stage the {@link Stage} of execution | |
32 | * @return A List of executable {@link Step}s | |
33 | */ | |
34 | List<Step> collectBeforeOrAfterStoriesSteps(List<CandidateSteps> candidateSteps, Stage stage); | |
35 | ||
36 | /** | |
37 | * Collects all of the {@link BeforeStory} or {@link AfterStory} steps to execute. | |
38 | * | |
39 | * @param candidateSteps the {@link CandidateSteps}. | |
40 | * @param story the {@link Story}. | |
41 | * @param stage the {@link Stage} of execution | |
42 | * @param givenStory whether {@link Story} is a given story | |
43 | * @return A List of executable {@link Step}s | |
44 | */ | |
45 | List<Step> collectBeforeOrAfterStorySteps(List<CandidateSteps> candidateSteps, Story story, Stage stage, boolean givenStory); | |
46 | ||
47 | /** | |
48 | * Collects all of the {@link BeforeScenario} or {@link AfterScenario} steps to execute. | |
49 | * | |
50 | * | |
51 | * @param candidateSteps the {@link CandidateSteps}. | |
52 | * @param storyAndScenarioMeta the story and scenario {@link org.jbehave.core.model.Meta} parameters | |
53 | * @param type the ScenarioType | |
54 | */ | |
55 | List<Step> collectBeforeOrAfterScenarioSteps(List<CandidateSteps> candidateSteps, Meta storyAndScenarioMeta, Stage stage, ScenarioType type); | |
56 | ||
57 | /** | |
58 | * Collects all of the {@link Step}s to execute for a scenario. | |
59 | * | |
60 | * @param candidateSteps the {@link CandidateSteps}. | |
61 | * @param scenario the {@link Scenario}. | |
62 | * @param parameters the parameters. | |
63 | * @return A List of executable {@link Step}s | |
64 | */ | |
65 | List<Step> collectScenarioSteps(List<CandidateSteps> candidateSteps, Scenario scenario, Map<String, String> parameters); | |
66 | } |