-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring context broken when migrating on 1.1.4 / Missing docs #569
Comments
Here you are a Spring example which shows that new way of running Cucumber JVM with Spring Framework |
What's the status of this issue? Does @ffbit's example address it ok? |
It seems to me that it will be nice to have documentation describing Spring Cucumber integration and some migration notes in readme.md under spring maven module. |
I think that would be awesome. Thanks for volunteering @ffbit |
I'm really eager to read the migration notes since we're experiencing some spring transactional problems with 1.1.4. When do you think you're writing them @ffbit? |
@hangvar I'm sorry for the delay, I really hope to finish them by/during this weekend. |
No update on this @ffbit? |
Hey @hangvar can you tell me what problems? I may be able to help you. |
Hi all, I just upgraded the cucumber-java and cucumber-spring (including all dependent other cucumber stuff) from 1.1.2 to 1.1.5. It was working with 1.1.2 without any kind of code addition. |
I'm upgrading cucumber. Upon upgrading from 1.1.3 to 1.1.4 I'm having this issue. I've tried the adding the following annotations to all my stepdefs files: and But none is working - I still get the exception. |
What is the exception? |
On 1.1.4.
And my stepdefs are currently annotated with:
|
It really seems that you have a stepdef class without the @ContextConfiguration annotation. If you don't have spring configurations classes you could update to version 1.1.5 and remove the @ContextConfiguration from the stepdefs, I think it should also work. |
I'm actually on my way to 1.1.5 but am stuck with another error there (latest message on the mailing list, can you have a look? Issue #637 ) Pedro Antonio Souza Viegas notifications@github.com wrote:
Sent from my Android phone with K-9 Mail. Please excuse my brevity. |
I'm updating cucumber to 1.1.5 and received NPE in my spring project i.e. @Autowired is not working. Is there any update for the resolution? |
Hey @mmalmeida if you are using the hooks you'll probably need the @ContextConfiguration anyways. The example for that is on examples/spring-txn. If you can also share a project on github, I could try to help you better. Thanks |
@pasviegas - I believe the example on examples/spring-txn is broken - see #637 . I comment on the need to use @ContextConfiguration there as well (which is why the example is actually broken). |
@aslakhellesoy ffbit's example shows how to use the @ContextConfiguration, but since the transaction hook glue path is wrong it actually exposes a new problem - either you annotate the Spring hook with @ContextConfiguration(cucumber.xml) and it will only work when you use cucumber.xml; or you don't annotate it and - right now - you end up with a class you can't use (NPE). I added #637 to specifically address this, although the documentation referenced here is also related to it. |
Sorry, but breaking compatability here is really bad. If you have 100s of steps which all run with a single cucumber.xml perfectly, you're now forced to annotate every single step?? That just makes it harder. It should be optional to annotate your steps. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When upgrading from 1.1.3 to 1.1.4, my working cucumber-spring project is now broken with message like:
Caused by: java.lang.IllegalArgumentException: Cannot load an ApplicationContext with a NULL 'contextLoader'. Consider annotating your test class with @ContextConfiguration.
The cucumber.xml file is not needed any more.
The Steps java file need to be annotated with @ContextConfiguration.
The documentation / examples should be updated to demonstrate the new way of running cucumber-jvm with a Spring context.
The text was updated successfully, but these errors were encountered: