-
-
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
Junit-Runner for Cucumber throws ClassNotFoundException if package name is 'cucumber' and no package for glue-code is specified #934
Comments
Silly me! The problem is of course, that the package-name for my test-runner-class is the same as cucumber itself. Been staring at this the whole afternoon and only realized it after creating the issue-report :-D |
Thank you, this report helped me as I had the same problem. |
@Argelbargel I LOVE YOU. SAVED MY LIFE <3 |
@awaisabir You are right! It saved my life tooo! Skkrrr pop pop! |
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 running cucumber-JVM with its JUnit-Runner using gradle i'm getting a ClassNotFoundException/NoClassDefFoundError if the package containing the class annotated with
@RunWith(Cucumber.class)
is named 'cucumber' and the package is not excluded (e.g. the glue path is set to another package using@CucumberOptions(glue=package)
.If RunCucumberTest is in a folder/package
/src/test/java/cucumber/RunCucumberTest.java
and the glue-code/step-definition atsrc/test/java/cucumber/steps
, then the following class produces a ClassNotFoundException:Stacktrace:
The exception is thrown for different classes when running the tests repeatedly, e.g.:
When I change the package where glue-code is searched, it works:
The gradle-project can be found at https://github.com/Argelbargel/cucumber-jvm-junit-classnotfoundexecption
The text was updated successfully, but these errors were encountered: