| 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 | |
|
| 8 | |
|
| 9 | |
public class StoryControls { |
| 10 | |
|
| 11 | 478 | private boolean dryRun = false; |
| 12 | 478 | private boolean resetStateBeforeStory = true; |
| 13 | 478 | private boolean resetStateBeforeScenario = true; |
| 14 | 478 | private boolean skipScenariosAfterFailure = false; |
| 15 | 478 | private boolean skipBeforeAndAfterScenarioStepsIfGivenStory = false; |
| 16 | |
|
| 17 | 478 | public StoryControls() { |
| 18 | 478 | } |
| 19 | |
|
| 20 | |
public boolean dryRun() { |
| 21 | 75 | return dryRun; |
| 22 | |
} |
| 23 | |
|
| 24 | |
public boolean resetStateBeforeStory() { |
| 25 | 18 | return resetStateBeforeStory; |
| 26 | |
} |
| 27 | |
|
| 28 | |
public boolean resetStateBeforeScenario() { |
| 29 | 21 | return resetStateBeforeScenario; |
| 30 | |
} |
| 31 | |
|
| 32 | |
public boolean skipScenariosAfterFailure() { |
| 33 | 5 | return skipScenariosAfterFailure; |
| 34 | |
} |
| 35 | |
|
| 36 | |
public boolean skipBeforeAndAfterScenarioStepsIfGivenStory() { |
| 37 | 17 | return skipBeforeAndAfterScenarioStepsIfGivenStory; |
| 38 | |
} |
| 39 | |
|
| 40 | |
public StoryControls doDryRun(boolean dryRun) { |
| 41 | 3 | this.dryRun = dryRun; |
| 42 | 3 | return this; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public StoryControls doResetStateBeforeScenario(boolean resetStateBeforeScenario) { |
| 46 | 3 | this.resetStateBeforeScenario = resetStateBeforeScenario; |
| 47 | 3 | return this; |
| 48 | |
} |
| 49 | |
|
| 50 | |
public StoryControls doResetStateBeforeStory(boolean resetStateBeforeStory) { |
| 51 | 1 | this.resetStateBeforeStory = resetStateBeforeStory; |
| 52 | 1 | return this; |
| 53 | |
} |
| 54 | |
|
| 55 | |
public StoryControls doSkipScenariosAfterFailure(boolean skipScenariosAfterFailure) { |
| 56 | 1 | this.skipScenariosAfterFailure = skipScenariosAfterFailure; |
| 57 | 1 | return this; |
| 58 | |
} |
| 59 | |
|
| 60 | |
public StoryControls doSkipBeforeAndAfterScenarioStepsIfGivenStory(boolean skipBeforeAndAfterScenarioStepsIfGivenStory) { |
| 61 | 1 | this.skipBeforeAndAfterScenarioStepsIfGivenStory = skipBeforeAndAfterScenarioStepsIfGivenStory; |
| 62 | 1 | return this; |
| 63 | |
} |
| 64 | |
|
| 65 | |
@Override |
| 66 | |
public String toString() { |
| 67 | 0 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); |
| 68 | |
} |
| 69 | |
|
| 70 | |
} |