JBehave
  1. JBehave
  2. JBEHAVE-217

Allow configuration to be overridden

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      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

        Mauro Talevi made changes -
        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 ]
        Hide
        Mauro Talevi added a comment -

        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.

        Show
        Mauro Talevi added a comment - 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.
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Chris Jensen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: