JBehave
  1. JBehave
  2. JBEHAVE-307

Rename RunnableStory to Embeddable and remove redundant methods

    Details

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

      Description

      The name RunnableStory has become outdated and does not reflect the fact that we can run multiple stories or even have access to other Embedder functionality. Embeddable is a more generic name that's better suited.

      The two methods that should remain in Embeddable are:

      void useEmbedder(Embedder);
      void run();

      The other methods that were previously in RunnableStory can live in abstract implementations, such as ConfigurableEmbedder which JUnitStory extends and allows the configuration of the embedder for execution of a single story.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Brian Repko added a comment -

        Not sure if this is a related issue or not.

        The following method change would make more sense in AbstractStory

        protected StoryEmbedder configuredEmbedder()

        { embedder.useConfiguration(getConfiguration()); embedder.useCandidateSteps(getSteps()); return embedder; }

        While the getters are no longer part of the interface, they could be protected and part of the AbstractStory.

        This allows a user to configure a story via overriding.

        Thus the options for story configuration are:

        1. Constructor
        2. Lifecycle method (@Before)
        3. Overriding getter methods

        This is important for use with IoC containers as they should not be started up in the constructor of the test class but rather as part of the running of the test.

        Show
        Brian Repko added a comment - Not sure if this is a related issue or not. The following method change would make more sense in AbstractStory protected StoryEmbedder configuredEmbedder() { embedder.useConfiguration(getConfiguration()); embedder.useCandidateSteps(getSteps()); return embedder; } While the getters are no longer part of the interface, they could be protected and part of the AbstractStory. This allows a user to configure a story via overriding. Thus the options for story configuration are: 1. Constructor 2. Lifecycle method (@Before) 3. Overriding getter methods This is important for use with IoC containers as they should not be started up in the constructor of the test class but rather as part of the running of the test.
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Mauro Talevi added a comment -

        Added protected methods configuration() and candidateSteps() that can be overridden.

        Show
        Mauro Talevi added a comment - Added protected methods configuration() and candidateSteps() that can be overridden.
        Mauro Talevi made changes -
        Summary Remove redundant getter methods in RunnableStory Renamed interface RunnableStory -> Embeddable and remove redundant methods
        Description RunnableStory getter methods are now redundant. They could lead to confusion as users may override them believing they would be used by the story embedder.

         

        The name RunnableStory has become outdated and does not reflect the fact that we can run multiple stories or even have access to other Embedder functionality. Embeddable is a more generic name that's better suited.

        The two methods that should remain in Embeddable are:

        void useEmbedder(Embedder);
        void run();

        The other methods that were previously in RunnableStory can live in abstract implementations, such as ConfigurableEmbedder which JUnitStory extends and allows the configuration of the embedder for execution of a single story.

         

        Mauro Talevi made changes -
        Summary Renamed interface RunnableStory -> Embeddable and remove redundant methods Rename RunnableStory -> Embeddable and remove redundant methods
        Mauro Talevi made changes -
        Summary Rename RunnableStory -> Embeddable and remove redundant methods Rename RunnableStory to Embeddable and remove redundant methods
        Mauro Talevi made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: