commit 61de2c72bacc96a8ae1e5624637851d10256725d
Author: Mauro Talevi <[email protected]>
AuthorDate: Sun Apr 8 11:30:11 2012 +0200
Commit: Mauro Talevi <[email protected]>
CommitDate: Sun Apr 8 11:30:11 2012 +0200
JBEHAVE-753: Removed configuration via StoryControls, as the presence of
anchor tags is currently used to detect the parametrisation by examples.
diff --git
a/examples/trader/src/main/java/org/jbehave/examples/trader/stories/GivenStoriesParametrisedByExamples.java
b/examples/trader/src/main/java/org/jbehave/examples/trader/stories/GivenStoriesParametrisedByExamples.java
index db8f5e5..b4bf661 100644
---
a/examples/trader/src/main/java/org/jbehave/examples/trader/stories/GivenStoriesParametrisedByExamples.java
+++
b/examples/trader/src/main/java/org/jbehave/examples/trader/stories/GivenStoriesParametrisedByExamples.java
@@ -1,17 +1,7 @@
package org.jbehave.examples.trader.stories;
-import org.jbehave.core.configuration.Configuration;
-import org.jbehave.core.embedder.StoryControls;
-import org.jbehave.core.steps.ParameterControls;
import org.jbehave.examples.trader.TraderStory;
public class GivenStoriesParametrisedByExamples extends TraderStory {
- @Override
- public Configuration configuration() {
- return super.configuration()
- .useParameterControls(new
ParameterControls().useDelimiterNamedParameters(true))
- .useStoryControls(new
StoryControls().doParametriseGivenStoriesByExamples(true));
- }
-
}
\ No newline at end of file
diff --git
a/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryControls.java
b/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryControls.java
index f5fac70..e4e21fe 100755
--- a/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryControls.java
+++ b/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryControls.java
@@ -9,7 +9,6 @@ import org.apache.commons.lang.builder.ToStringStyle;
public class StoryControls {
private boolean dryRun = false;
- private boolean parametriseGivenStoriesByExamples = false;
private boolean resetStateBeforeStory = true;
private boolean resetStateBeforeScenario = true;
private boolean skipScenariosAfterFailure = false;
@@ -24,10 +23,6 @@ public class StoryControls {
return dryRun;
}
- public boolean parametriseGivenStoriesByExamples() {
- return parametriseGivenStoriesByExamples;
- }
-
public boolean resetStateBeforeStory() {
return resetStateBeforeStory;
}
@@ -57,11 +52,6 @@ public class StoryControls {
return this;
}
- public StoryControls doParametriseGivenStoriesByExamples(boolean
parametriseGivenStoriesByExamples) {
- this.parametriseGivenStoriesByExamples =
parametriseGivenStoriesByExamples;
- return this;
- }
-
public StoryControls doResetStateBeforeScenario(boolean
resetStateBeforeScenario) {
this.resetStateBeforeScenario = resetStateBeforeScenario;
return this;
diff --git
a/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java
b/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java
index a40646a..4de1f36 100755
--- a/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java
+++ b/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java
@@ -286,10 +286,6 @@ public class StoryRunner {
}
if (isParameterisedByExamples(scenario)) { // run
parametrised scenarios by examples
- // run any given stories, if not parametrised by
examples
- if (
!context.configuration.storyControls().parametriseGivenStoriesByExamples() ){
- runGivenStories(scenario, new HashMap<String,
String>(), context);
- }
runScenariosParametrisedByExamples(context, scenario,
storyAndScenarioMeta);
} else { // run as plain old scenario
addMetaParameters(storyParameters,
storyAndScenarioMeta);
@@ -396,9 +392,7 @@ public class StoryRunner {
}
runBeforeOrAfterScenarioSteps(context, scenario,
storyAndScenarioMeta, Stage.BEFORE, ScenarioType.EXAMPLE);
addMetaParameters(scenarioParameters, storyAndScenarioMeta);
- if (
context.configuration().storyControls().parametriseGivenStoriesByExamples() ){
runGivenStories(scenario, scenarioParameters, context);
- }
runScenarioSteps(context, scenario, scenarioParameters);
runBeforeOrAfterScenarioSteps(context, scenario,
storyAndScenarioMeta, Stage.AFTER, ScenarioType.EXAMPLE);
}