I have tracked this down to a null parameter in PerfomableTree that should be the uuid exception if there is a failure.

The diff below are my changes, not thoroughly tested, a unit test would be good (the screenshot now works for the esty test, but there may be more failures).

The strange formatting is due to tabs in the source code, I can do a more elaborate diff maybe with a unit test later today when I have set up my git repositories again properly.

diff --git a/jbehave-core/src/main/java/org/jbehave/core/embedder/PerformableTree.java b/jbehave-core/src/main/java/org/jbehave/core/embedder/PerformableTree.java
index dcbd812..da9fc51 100644
--- a/jbehave-core/src/main/java/org/jbehave/core/embedder/PerformableTree.java
+++ b/jbehave-core/src/main/java/org/jbehave/core/embedder/PerformableTree.java
@@ -848,7 +848,13 @@ public class PerformableTree {
             results = new ArrayList<StepResult>();
             for (Step step : steps) {
 				context.interruptIfCancelled();
-				state = state.run(step, results, reporter, null);
+				UUIDExceptionWrapper uuidFailure;
+				if(state instanceof SomethingHappened) {
+					uuidFailure = ((SomethingHappened)state).scenarioFailure;
+				} else {
+					uuidFailure = null;
+				}
+				state = state.run(step, results, reporter, uuidFailure);
             }
             context.stateIs(state);
             List<PendingStep> pendingSteps = pendingSteps(steps);

(two style questions:

I think it would easier if the State interface had a method getScenarioFailure that returns null if it is not SomethingHappened, unless you prefer to keep the interface to the single method that is really implemented by both classes

The if would be easier as ?: _expression_, unless we consider that statement undesirable

state = state.run(step, results, reporter, state instanceof SomethingHappened ? ((SomethingHappened)state).scenarioFailure : null;

)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to