##### Coverage Report - org.jbehave.core.embedder.StoryControls

Classes in this File | Line Coverage | Branch Coverage | Complexity
StoryControls |
96% | 30/31
N/A | N/A
| 1.0;1

1 |  |
     package org.jbehave.core.embedder;
2 |  |
3 |  |
     import org.apache.commons.lang.builder.ToStringBuilder;
4 |  |
     import org.apache.commons.lang.builder.ToStringStyle;
5 |  |
6 |  |
     /**
7 |  |
      * Holds flags used by the StoryRunner to control story execution flow.
8 |  |
      */
9 |  |
     public class StoryControls {
10 |  |
11 | 648 |
         private boolean dryRun = false;
12 | 648 |
         private boolean resetStateBeforeStory = true;
13 | 648 |
         private boolean resetStateBeforeScenario = true;
14 | 648 |
         private boolean skipScenariosAfterFailure = false;
15 | 648 |
         private boolean skipBeforeAndAfterScenarioStepsIfGivenStory = false;
16 | 648 |
         private String storyMetaPrefix = "";
17 | 648 |
         private String scenarioMetaPrefix = "";
18 |  |
19 | 648 |
         public StoryControls() {
20 | 648 |
         }
21 |  |
22 |  |
         public boolean dryRun() {
23 | 100 |
             return dryRun;
24 |  |
         }
25 |  |
26 |  |
         public boolean resetStateBeforeStory() {
27 | 24 |
             return resetStateBeforeStory;
28 |  |
         }
29 |  |
30 |  |
         public boolean resetStateBeforeScenario() {
31 | 26 |
             return resetStateBeforeScenario;
32 |  |
         }
33 |  |
34 |  |
         public boolean skipScenariosAfterFailure() {
35 | 5 |
             return skipScenariosAfterFailure;
36 |  |
         }
37 |  |
38 |  |
         public boolean skipBeforeAndAfterScenarioStepsIfGivenStory() {
39 | 22 |
             return skipBeforeAndAfterScenarioStepsIfGivenStory;
40 |  |
         }
41 |  |
42 |  |
         public String storyMetaPrefix() {
43 | 44 |
             return storyMetaPrefix;
44 |  |
         }
45 |  |
46 |  |
         public String scenarioMetaPrefix() {
47 | 44 |
             return scenarioMetaPrefix;
48 |  |
         }
49 |  |
50 |  |
         public StoryControls doDryRun(boolean dryRun) {
51 | 3 |
             this.dryRun = dryRun;
52 | 3 |
             return this;
53 |  |
         }
54 |  |
55 |  |
         public StoryControls doResetStateBeforeScenario(boolean resetStateBeforeScenario) {
56 | 3 |
             this.resetStateBeforeScenario = resetStateBeforeScenario;
57 | 3 |
             return this;
58 |  |
         }
59 |  |
60 |  |
         public StoryControls doResetStateBeforeStory(boolean resetStateBeforeStory) {
61 | 1 |
             this.resetStateBeforeStory = resetStateBeforeStory;
62 | 1 |
             return this;
63 |  |
         }
64 |  |
65 |  |
         public StoryControls doSkipScenariosAfterFailure(boolean skipScenariosAfterFailure) {
66 | 1 |
             this.skipScenariosAfterFailure = skipScenariosAfterFailure;
67 | 1 |
             return this;
68 |  |
         }
69 |  |
70 |  |
         public StoryControls doSkipBeforeAndAfterScenarioStepsIfGivenStory(boolean skipBeforeAndAfterScenarioStepsIfGivenStory) {
71 | 1 |
             this.skipBeforeAndAfterScenarioStepsIfGivenStory = skipBeforeAndAfterScenarioStepsIfGivenStory;
72 | 1 |
             return this;
73 |  |
         }
74 |  |
75 |  |
         public StoryControls useStoryMetaPrefix(String storyMetaPrefix){
76 | 1 |
             this.storyMetaPrefix = storyMetaPrefix;
77 | 1 |
             return this;
78 |  |
         }
79 |  |
80 |  |
         public StoryControls useScenarioMetaPrefix(String scenarioMetaPrefix){
81 | 1 |
             this.scenarioMetaPrefix = scenarioMetaPrefix;
82 | 1 |
             return this;
83 |  |
         }
84 |  |
85 |  |
         @Override
86 |  |
         public String toString() {
87 | 0 |
             return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
88 |  |
         }
89 |  |
90 |  |
     }