It seems that if i activate cucumber-weld (with org.jboss.weld.se), this happens:
@Before public void before() { ExampleClass ec = new ExampleClass(); } @Given("^someGiven") public void given() { ec.bar();<----throws nullpointer with cucumber-weld activated } @When("^someWhen") public void when() { ec.bar();<----throws nullpointer with cucumber-weld activated } @Then("^someGiven") public void then() { ec.bar();<----throws nullpointer with cucumber-weld activated }Looks like that every method is executed independently and a scenario can't hold a state in this way. As soon as i remove "org.jboss.weld.se" from my pom.xml CDI doesnt work anymore (as expected) but the Nullpointers are gone. Tested with (1.1.2 and 1.1.3)
I checked out this code also and confirmed the issue too "https://github.com/GallifreyanCode/cucumber-jvm-examples/tree/master/cucumber-example-cdi" (cucumber 1.0.0.RC20)
Aslak Hellesøy said this is not a bug, but that im doing something wrong, did anyone encounter this issue? Or can help me to solve it?Greetings--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It seems that if i activate cucumber-weld (with org.jboss.weld.se), this happens:
@Before public void before() { ExampleClass ec = new ExampleClass(); } @Given("^someGiven") public void given() { ec.bar();<----throws nullpointer with cucumber-weld activated } @When("^someWhen") public void when() { ec.bar();<----throws nullpointer with cucumber-weld activated } @Then("^someGiven") public void then() { ec.bar();<----throws nullpointer with cucumber-weld activated }
Sorry, here is a gist with the corresponding files.
On Friday, May 17, 2013 4:31:20 PM UTC+2, Marvin Schramm wrote:It seems that if i activate cucumber-weld (with org.jboss.weld.se), this happens:
@Before public void before() { ExampleClass ec = new ExampleClass(); } @Given("^someGiven") public void given() { ec.bar();<----throws nullpointer with cucumber-weld activated } @When("^someWhen") public void when() { ec.bar();<----throws nullpointer with cucumber-weld activated } @Then("^someGiven") public void then() { ec.bar();<----throws nullpointer with cucumber-weld activated }Looks like that every method is executed independently and a scenario can't hold a state in this way. As soon as i remove "org.jboss.weld.se" from my pom.xml CDI doesnt work anymore (as expected) but the Nullpointers are gone. Tested with (1.1.2 and 1.1.3)
I checked out this code also and confirmed the issue too "https://github.com/GallifreyanCode/cucumber-jvm-examples/tree/master/cucumber-example-cdi" (cucumber 1.0.0.RC20)
Aslak Hellesøy said this is not a bug,
but that im doing something wrong, did anyone encounter this issue? Or can help me to solve it?Greetings
Please read up on rule 2 at the bottom of the message.
On Fri, May 17, 2013 at 9:54 AM, Marvin Schramm <marvin....@gmail.com> wrote:
Sorry, here is a gist with the corresponding files.Ok, so something is null. What's null?
On Friday, May 17, 2013 5:04:26 PM UTC+2, Aslak Hellesøy wrote:Please read up on rule 2 at the bottom of the message.OKOn Fri, May 17, 2013 at 9:54 AM, Marvin Schramm <marvin....@gmail.com> wrote:
Sorry, here is a gist with the corresponding files.
Ok, so something is null. What's null?Well the DataAccessObject is null. It seems that the StepClass is created for every Step new ( I created a constructor in the StepDefs.Class to confirm that).
On Fri, May 17, 2013 at 10:13 AM, Marvin Schramm <marvin....@gmail.com> wrote:
On Friday, May 17, 2013 5:04:26 PM UTC+2, Aslak Hellesøy wrote:Please read up on rule 2 at the bottom of the message.OKOn Fri, May 17, 2013 at 9:54 AM, Marvin Schramm <marvin....@gmail.com> wrote:
Sorry, here is a gist with the corresponding files.
Ok, so something is null. What's null?Well the DataAccessObject is null. It seems that the StepClass is created for every Step new ( I created a constructor in the StepDefs.Class to confirm that).If that was the case, this change would have broken the build:
Each stepdef class instantiated once for every *scenario* and then reused for every *step*.How did you conclude that you get a new instance for every step?