Title: [1630] trunk/core/examples/trader: JBEHAVE-282: Reset error state only for non-embedded stories.
Revision
1630
Author
mauro
Date
2010-05-05 17:36:51 -0500 (Wed, 05 May 2010)

Log Message

JBEHAVE-282:  Reset error state only for non-embedded stories.

Modified Paths

Diff

Modified: trunk/core/examples/trader/pom.xml (1629 => 1630)

--- trunk/core/examples/trader/pom.xml	2010-05-05 19:54:46 UTC (rev 1629)
+++ trunk/core/examples/trader/pom.xml	2010-05-05 22:36:51 UTC (rev 1630)
@@ -91,8 +91,9 @@
                 <scenarioInclude>**/scenarios/*.java</scenarioInclude>
               </scenarioIncludes>
               <scenarioExcludes>
+                <scenarioExclude>**/i18n/scenarios/*.java</scenarioExclude>
+                <scenarioExclude>**/scenarios/Failure*.java</scenarioExclude>
                 <scenarioExclude>**/scenarios/*NonSuccessful.java</scenarioExclude>
-                <scenarioExclude>**/i18n/scenarios/*.java</scenarioExclude>
               </scenarioExcludes>
               <skip>false</skip>
               <batch>false</batch>

Modified: trunk/core/examples/trader-test-scope/pom.xml (1629 => 1630)

--- trunk/core/examples/trader-test-scope/pom.xml	2010-05-05 19:54:46 UTC (rev 1629)
+++ trunk/core/examples/trader-test-scope/pom.xml	2010-05-05 22:36:51 UTC (rev 1630)
@@ -43,6 +43,7 @@
               </scenarioIncludes>
               <scenarioExcludes>
                 <scenarioExclude>**/i18n/scenarios/*.java</scenarioExclude>
+                <scenarioExclude>**/scenarios/Failure*.java</scenarioExclude>
                 <scenarioExclude>**/*NonSuccessful.java</scenarioExclude>
               </scenarioExcludes>
               <skip>false</skip>

Modified: trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/ScenarioRunner.java (1629 => 1630)

--- trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/ScenarioRunner.java	2010-05-05 19:54:46 UTC (rev 1629)
+++ trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/ScenarioRunner.java	2010-05-05 22:36:51 UTC (rev 1630)
@@ -53,8 +53,7 @@
         reporter = configuration.forReportingScenarios();
         pendingStepStrategy = configuration.forPendingSteps();
         errorStrategy = configuration.forHandlingErrors();
-        currentStrategy = ErrorStrategy.SILENT;
-        throwable = null;
+        resetErrorState(embeddedStory);
         
         reporter.beforeStory(story, embeddedStory);          
         runStorySteps(story, embeddedStory, StepCreator.Stage.BEFORE, candidateSteps);
@@ -69,10 +68,19 @@
     		reporter.afterScenario();
         }
         runStorySteps(story, embeddedStory, StepCreator.Stage.AFTER, candidateSteps);
-        reporter.afterStory(embeddedStory);            
+        reporter.afterStory(embeddedStory);                          
         currentStrategy.handleError(throwable);
     }
 
+	private void resetErrorState(boolean embeddedStory) {
+		if ( embeddedStory ) {
+			// do not reset error state for embedded stories
+			return;
+		}
+		currentStrategy = ErrorStrategy.SILENT;
+		throwable = null;
+	}
+
     private void runGivenScenarios(Configuration configuration,
 			ScenarioDefinition scenario, CandidateSteps... candidateSteps)
 			throws Throwable {


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to