JBehave
  1. JBehave
  2. JBEHAVE-254

Merge story/steps configuration

    Details

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

      Description

      Story and steps configuration should be merged, maintaining what worked well and removing what did not.

      Criterias for refactor:

      • Elements of the configuration should always have default values and should be overridable singularly, after instantiation.
      • Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods. ImmutableConfiguration decorator should throw an exception when use* method invoked.
      • Default MostUsefulConfiguration should always be available to runners and should not be required as parameters in super() invocations.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Description Story configuration should be possible by composition rather than inheritance.

        Moreover the elements of the default configuration should be overridable, singularly and after the instantiation of the class responsible for running the story.

        Story and steps configuration should be reviewed to maintain what worked well and remove what did not.

        Criterias for refactor:
        - Adopt similar paradigm for story and steps configuration
        - Elements of the configuration should always have default values and should
        be overridable singularly, after instantiation
        - Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods.
        - Default configurations should always be available to runners and should not be required as parameters in super() invocations.

        Have a base abstract class [Story|Steps]Configuration that holds the elements of the configuration, injectable both via constructor and after instantiation via use* methods.

        Have a MostUseful[Story|Steps]Configuration that holds the default configuration that can be used as base for overriding individual elements.

        Have an Immutable[Story|Steps]Configuration throwing an exception when use* methods invoked.

        Summary Allow story configuration by composition rather than inheritance Review story/steps configuration
        Mauro Talevi made changes -
        Description Story and steps configuration should be reviewed to maintain what worked well and remove what did not.

        Criterias for refactor:
        - Adopt similar paradigm for story and steps configuration
        - Elements of the configuration should always have default values and should
        be overridable singularly, after instantiation
        - Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods.
        - Default configurations should always be available to runners and should not be required as parameters in super() invocations.

        Have a base abstract class [Story|Steps]Configuration that holds the elements of the configuration, injectable both via constructor and after instantiation via use* methods.

        Have a MostUseful[Story|Steps]Configuration that holds the default configuration that can be used as base for overriding individual elements.

        Have an Immutable[Story|Steps]Configuration throwing an exception when use* methods invoked.

        Story and steps configuration should be reviewed to maintain what worked well and remove what did not.

        Criterias for refactor:
        - Adopt similar paradigm for story and steps configuration
        - Elements of the configuration should always have default values and should be overridable singularly, after instantiation
        - Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods.
        - Default configurations should always be available to runners and should not be required as parameters in super() invocations.

        Changes:
        - Have a base abstract class [Story|Steps]Configuration that holds the elements of the configuration, injectable both via constructor and after instantiation via use* methods.
        - Have a MostUseful[Story|Steps]Configuration that holds the default configuration that can be used as base for overriding individual elements.
        - Have an Immutable[Story|Steps]Configuration throwing an exception when use* methods invoked.

        Hide
        Mauro Talevi added a comment - - edited

        Renamed Configuration to StoryConfiguration and converted interface to abstract class.

        JUnitStory always starts with MostUsefulStoryConfiguration and allows overriding configuration only via useConfiguration(StoryConfiguration) method.

        Added MostUsefulStepsConfiguration and Unmodifiable[Story|Steps]Configuration decorators.

        Show
        Mauro Talevi added a comment - - edited Renamed Configuration to StoryConfiguration and converted interface to abstract class. JUnitStory always starts with MostUsefulStoryConfiguration and allows overriding configuration only via useConfiguration(StoryConfiguration) method. Added MostUsefulStepsConfiguration and Unmodifiable [Story|Steps] Configuration decorators.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mauro Talevi made changes -
        Assignee Mauro Talevi [ maurotalevi ]
        Hide
        Cristiano Gavião added a comment -

        Mauro, should be possible that all jbehave configuration classes have one constructor annotated with @javax.inject.Inject, so we could use DI for all jbehave configuration stuffs ?

        regards

        Cristiano

        Show
        Cristiano Gavião added a comment - Mauro, should be possible that all jbehave configuration classes have one constructor annotated with @javax.inject.Inject, so we could use DI for all jbehave configuration stuffs ? regards Cristiano
        Hide
        Mauro Talevi added a comment -

        Created separate issue JBEHAVE-265 to track annotation-based configuration.

        Show
        Mauro Talevi added a comment - Created separate issue JBEHAVE-265 to track annotation-based configuration.
        Mauro Talevi made changes -
        Summary Review story/steps configuration Merge story/steps configuration
        Description Story and steps configuration should be reviewed to maintain what worked well and remove what did not.

        Criterias for refactor:
        - Adopt similar paradigm for story and steps configuration
        - Elements of the configuration should always have default values and should be overridable singularly, after instantiation
        - Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods.
        - Default configurations should always be available to runners and should not be required as parameters in super() invocations.

        Changes:
        - Have a base abstract class [Story|Steps]Configuration that holds the elements of the configuration, injectable both via constructor and after instantiation via use* methods.
        - Have a MostUseful[Story|Steps]Configuration that holds the default configuration that can be used as base for overriding individual elements.
        - Have an Immutable[Story|Steps]Configuration throwing an exception when use* methods invoked.

        Story and steps configuration should be merged, maintaining what worked well and removing what did not.

        Criterias for refactor:
        - Elements of the configuration should always have default values and should be overridable singularly, after instantiation.
        - Immutability of configuration can be obtained by decorating a configuration and disabling the use* methods. ImmutableConfiguration decorator should throw an exception when use* method invoked.
        - Default MostUsefulConfiguration should always be available to runners and should not be required as parameters in super() invocations.


          People

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

            Dates

            • Created:
              Updated:
              Resolved: