Details
Description
Currently to configure a scenario you need to implement an interface and it ties configuration to the scenario author. From what I can see the only way to externally override configuration would be to use AOP. This isn't a very standard way of doing configuration. It should use public getter and setter methods so the configuration can be overridden or extended to, for instance, add in a scenario reporter.
Ideally I should be able to write a Sonar plug-in for JBehave that can run existing scenarios and capture their output for presentation within Sonar. To make this work for everyone out of the box, I shouldn't need to resort to using AOP or to requiring special per-scenario configuration by people who want to get nice reporting in Sonar.
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Mauro Talevi [ maurotalevi ] | |
Summary | Allow configuration to be set | Allow configuration to be overridden |
Fix Version/s | 2.4 [ 15664 ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Added useConfiguration(Configuration) method to Scenario to override existing or default configuration. The term useXXX is preferred to setXXX to convey that that we are instructing an override of an existing and previously injected dependency.
Also getConfiguration() method allows the inspection of the current configuration.
Updated the trader example ReportCanBeWrittenToFile to show the use of new override method.