JBehave
  1. JBehave
  2. JBEHAVE-543

Before/After Story/Scenario methods could accept parameters that have meaning at that moment

    Details

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

      Description

      For example -

      public void myBeforeStory(@Named("someMetaTag") String someMetaTag) { .. }

      This would be a poor-mans version of JBEHAVE-541

        Activity

        Hide
        Adriano Bonat added a comment -

        I've been working on this new feature, you can check my branch' commits here:
        https://github.com/tanob/jbehave-core/commits/jbehave-543

        Show
        Adriano Bonat added a comment - I've been working on this new feature, you can check my branch' commits here: https://github.com/tanob/jbehave-core/commits/jbehave-543
        Hide
        Mauro Talevi added a comment -

        Thanks Adriano, looks like some nice very work at first sight. I'll dig in a bit deeper tomorrow.

        Just one thing, can you avoid removing "unnecessary comments"

        https://github.com/tanob/jbehave-core/commit/d28f43d843d425dafe0087eba23c62e1c742a1ed

        Show
        Mauro Talevi added a comment - Thanks Adriano, looks like some nice very work at first sight. I'll dig in a bit deeper tomorrow. Just one thing, can you avoid removing "unnecessary comments" https://github.com/tanob/jbehave-core/commit/d28f43d843d425dafe0087eba23c62e1c742a1ed
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.5 [ 17393 ]
        Hide
        Mauro Talevi added a comment -

        Adriano, I pulled your commits (except the one above) but there is a regression. The trader-weld example fails.

        Have you tried running mvn clean install -Pexamples on git://github.com/tanob/jbehave-core.git?

        Looks like a NPE somewhere in the class names. But Weld is not exactly generous with debug help

        Show
        Mauro Talevi added a comment - Adriano, I pulled your commits (except the one above) but there is a regression. The trader-weld example fails. Have you tried running mvn clean install -Pexamples on git://github.com/tanob/jbehave-core.git? Looks like a NPE somewhere in the class names. But Weld is not exactly generous with debug help
        Mauro Talevi made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Mauro Talevi made changes -
        Component/s Core [ 11086 ]
        Hide
        Adriano Bonat added a comment -

        Hey Mauro, thanks for letting me know that I should also test with "-Pexamples", it will be useful

        About the issue, it is happening in your master too and it is a bug in Weld:
        https://issues.jboss.org/browse/WELD-897

        they're generating java class names with illegal characters for their proxies. The Weld example never really worked and the build with profile 'examples' is broken since Paul added it back to the examples' pom.xml:
        https://github.com/jbehave/jbehave-core/commit/da2e5e0a56edf2f0b7cf3fe2fbf4889c9ba8047d

        I got success after upgrading to Weld-se 1.1.1.Final and you can pull my checkin:
        https://github.com/tanob/jbehave-core/commit/30feb5b7815da73fcd78ef14c8f8fba40797f465

        Would be better if you add the 'examples' build in the CI environment, so you will be aware of any breakage on them.

        Now talking about this ticket, I've made a great progress in the last couple of days and hope to finish everything in the next days, so stay tuned!

        Show
        Adriano Bonat added a comment - Hey Mauro, thanks for letting me know that I should also test with "-Pexamples", it will be useful About the issue, it is happening in your master too and it is a bug in Weld: https://issues.jboss.org/browse/WELD-897 they're generating java class names with illegal characters for their proxies. The Weld example never really worked and the build with profile 'examples' is broken since Paul added it back to the examples' pom.xml: https://github.com/jbehave/jbehave-core/commit/da2e5e0a56edf2f0b7cf3fe2fbf4889c9ba8047d I got success after upgrading to Weld-se 1.1.1.Final and you can pull my checkin: https://github.com/tanob/jbehave-core/commit/30feb5b7815da73fcd78ef14c8f8fba40797f465 Would be better if you add the 'examples' build in the CI environment, so you will be aware of any breakage on them. Now talking about this ticket, I've made a great progress in the last couple of days and hope to finish everything in the next days, so stay tuned!
        Hide
        Mauro Talevi added a comment -

        Upgraded to Weld 1.1.1 in JBEHAVE-553.

        Show
        Mauro Talevi added a comment - Upgraded to Weld 1.1.1 in JBEHAVE-553 .
        Hide
        Mauro Talevi added a comment -

        Pulled commits into master up to https://github.com/tanob/jbehave-core/commit/32b6770d8661ce942ac76c88549071d9998b332e

        Can you please merge with master?

        Yes, we should get the example in CI. I'm actually planning to move away from Codehaus Bamboo, as I find some features annoying (like the non possibility of deleting build configs).

        Any suggestion on where we should set up JBehave CI?

        Show
        Mauro Talevi added a comment - Pulled commits into master up to https://github.com/tanob/jbehave-core/commit/32b6770d8661ce942ac76c88549071d9998b332e Can you please merge with master? Yes, we should get the example in CI. I'm actually planning to move away from Codehaus Bamboo, as I find some features annoying (like the non possibility of deleting build configs). Any suggestion on where we should set up JBehave CI?
        Hide
        Mauro Talevi added a comment -
        Show
        Mauro Talevi added a comment - In the meantime: http://builds.codehaus.org/browse/JBEHAVE-CORE3EXAMPLES
        Hide
        Adriano Bonat added a comment -

        Unfortunately I don't know where we could setup the CI, but nice that you added the examples to the current one

        Over the weekend I did check in some other parts for this ticket and I have the following remaining items:

        • finish TODO around reporting;
        • do refactoring on StepCreator to have only MethodInvoker;
        • add/adapt examples using this feature;

        Please let me know if you have any feedback.

        Show
        Adriano Bonat added a comment - Unfortunately I don't know where we could setup the CI, but nice that you added the examples to the current one Over the weekend I did check in some other parts for this ticket and I have the following remaining items: finish TODO around reporting; do refactoring on StepCreator to have only MethodInvoker; add/adapt examples using this feature; Please let me know if you have any feedback.
        Hide
        Mauro Talevi added a comment -

        Hi Adriano, I've pulled your commits. Did not see any issues with them.

        What do you mean by refactoring StepCreator to only have MethodInvoker?

        Examples of the new feature would be most welcome.

        Thanks for your great work!

        Show
        Mauro Talevi added a comment - Hi Adriano, I've pulled your commits. Did not see any issues with them. What do you mean by refactoring StepCreator to only have MethodInvoker? Examples of the new feature would be most welcome. Thanks for your great work!
        Hide
        Adriano Bonat added a comment -

        Hey Mauro,

        I've checked in some examples using this feature and after some thought I didn't see a reason to report the execution of the parametrized before/after annotations, so I've removed the TODO.

        About the refactoring in StepCreator, the idea is delegate the method invocation in the ParametrisedStep to the MethodInvoker that this task introduced. I've started this yesterday but still need to see how can I keep the current reporting calls working as they do currently.

        Sorry for the delayed reply

        Show
        Adriano Bonat added a comment - Hey Mauro, I've checked in some examples using this feature and after some thought I didn't see a reason to report the execution of the parametrized before/after annotations, so I've removed the TODO. About the refactoring in StepCreator, the idea is delegate the method invocation in the ParametrisedStep to the MethodInvoker that this task introduced. I've started this yesterday but still need to see how can I keep the current reporting calls working as they do currently. Sorry for the delayed reply
        Hide
        Mauro Talevi added a comment -

        Adriano,

        resolving issue as it is feature complete.

        Any additional refactor should be dealt with by opening a separate issue.

        Show
        Mauro Talevi added a comment - Adriano, resolving issue as it is feature complete. Any additional refactor should be dealt with by opening a separate issue.
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Adriano Bonat added a comment -

        Mauro, please have a look in my branch since there are 3 commits not merged:
        https://github.com/tanob/jbehave-core/commits/jbehave-543

        Thanks

        Show
        Adriano Bonat added a comment - Mauro, please have a look in my branch since there are 3 commits not merged: https://github.com/tanob/jbehave-core/commits/jbehave-543 Thanks
        Hide
        Mauro Talevi added a comment -

        Merged, thanks!

        Show
        Mauro Talevi added a comment - Merged, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: