JBehave
  1. JBehave
  2. JBEHAVE-744

Unit test can fail due to random list ordering

    Details

    • Type: Test Test
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.4
    • Fix Version/s: 3.6
    • Component/s: Core
    • Labels:
      None
    • Environment:
      jbehave 3.6-snapshot, windows vista, java 1.6.0-31
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      Unit test shouldMatchCompositeStepsAndCreateComposedNestedSteps fails for me, this is due to some environment difference either with the java version, class loader or something like that, because the List returned by steps.listCandidates is not necessarily ordered according to the order of the methods in the steps class.
      When I run the test in Eclipse debugger, the order is as expected, when I run the test normal in maven or in Eclipse, it fails since the expected step is at the end of the list.

      I have changed the unit test to look for the correct step, this way the test should always pass.

        Activity

        Hide
        Alexander Lehmann added a comment -

        https://github.com/alexlehm/jbehave-core/commit/d562fa92f3c9766b07f18d4d9aef84ad54ff1bec

        JBEHAVE-744: Unit test CompositeStepCandidateBehaviour.shouldMatchCompositeStepsAndCreateComposedNestedSteps can fail due to random list ordering
        added lookup for base step

        Show
        Alexander Lehmann added a comment - https://github.com/alexlehm/jbehave-core/commit/d562fa92f3c9766b07f18d4d9aef84ad54ff1bec JBEHAVE-744 : Unit test CompositeStepCandidateBehaviour.shouldMatchCompositeStepsAndCreateComposedNestedSteps can fail due to random list ordering added lookup for base step
        Mauro Talevi made changes -
        Field Original Value New Value
        Summary Unit test CompositeStepCandidateBehaviour.shouldMatchCompositeStepsAndCreateComposedNestedSteps can fail due to random list ordering Unit test can fail due to random list ordering
        Fix Version/s 3.6 [ 17721 ]
        Affects Version/s 3.5.4 [ 18081 ]
        Affects Version/s 3.6 [ 17721 ]
        Hide
        Mauro Talevi added a comment -

        Pulled patch with thanks.

        Show
        Mauro Talevi added a comment - Pulled patch with thanks.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander Lehmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: