Scenario metadata overwrite

Description

Overview
A bug was introduced with the 4.0 release which effects scenario level metadata. If scenario level metadata is passed into steps as named parameters, then the wrong values are sometimes used. For example, the scenario 3 metadata is passed into the scenario 1 step.

Details
It appears that the PerformableStory is constructed, a property map is passed into each PerformableScenario where it is flushed out with Story and Scenario level metadata and then stored with the PerformableScenario for named parameter matching when the scenario is run. However all PerformableScenarios are sharing the same NamedParameter map passed in from the PerformableStory. Therefore when each scenario is parsed and the PerformableScenario created, the map is updated which effects all the scenarios.

Impact
Test suites that were written against 3.x and use scenario level metadata within their steps fail or report incorrect results when upgrading to JBehave 4.x.

Fix
The PerformableScenarios need to create and store a separate copy of the NamedParameter map to that this overwriting does not occur.

Assignee

Mauro Talevi

Reporter

Brian Saylor

Labels

None

Fix versions

Priority

Critical
Configure