JBehave
  1. JBehave
  2. JBEHAVE-900

Honor order in @UsingSteps instances

    Details

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

      Description

      Although step class dependencies are not recommended, in some cases it is useful (e.g. when managing a per-scenario transactional Spring context).
      Currently, the order of steps in @UsingSteps instances are hashed twice,once in AnnotationFinder and once more in InstanceStepsFactory, making the order of e.g. @BeforeScenario unreliable.
      Find attached new versions of these classes, based off of 3.7.5 source, where the order is retained.

      1. AnnotationFinder.java
        3 kB
        Jonas Olsson
      2. InstanceStepsFactory.java
        1 kB
        Jonas Olsson

        Activity

        Hide
        Mauro Talevi added a comment -

        Could you present a usecase where this is happening? Ideally in a unit test or a scenario.

        Also, could you please provide the patch in a commit in github: http://jbehave.org/reference/stable/how-to-contribute.html

        Thanks

        Show
        Mauro Talevi added a comment - Could you present a usecase where this is happening? Ideally in a unit test or a scenario. Also, could you please provide the patch in a commit in github: http://jbehave.org/reference/stable/how-to-contribute.html Thanks
        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.8 [ 19104 ]
        Show
        Jonas Olsson added a comment - https://github.com/mirvnillith/jbehave-core/commit/4ee794d1317086b0a3380427cf12ff62882574fe
        Mauro Talevi made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Mauro Talevi added a comment -

        The proposed patch did not pass other tests. Instead linked hash set and map implementations are now used to ensure order.

        The ensuring_order_using_steps.story has been added to trader example.

        Show
        Mauro Talevi added a comment - The proposed patch did not pass other tests. Instead linked hash set and map implementations are now used to ensure order. The ensuring_order_using_steps.story has been added to trader example.
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Mauro Talevi made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jonas Olsson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: