Skip to content
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

org.junit.runners.model.InitializationError with JUnit 4.12 #792

Closed
vanackej opened this issue Oct 30, 2014 · 7 comments
Closed

org.junit.runners.model.InitializationError with JUnit 4.12 #792

vanackej opened this issue Oct 30, 2014 · 7 comments

Comments

@vanackej
Copy link

Hi,

Cucumber-JVM is incompatible with JUnit 4.12. It fails with the following stacktrace :

cucumber.runtime.CucumberException: Failed to create scenario runner
    at cucumber.runtime.junit.FeatureRunner.buildFeatureElementRunners(FeatureRunner.java:85)
    at cucumber.runtime.junit.FeatureRunner.<init>(FeatureRunner.java:31)
    at cucumber.api.junit.Cucumber.addChildren(Cucumber.java:102)
    at cucumber.api.junit.Cucumber.<init>(Cucumber.java:65)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.junit.runners.model.InitializationError
    at org.junit.runners.ParentRunner.validate(ParentRunner.java:418)
    at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
    at org.junit.runners.Suite.<init>(Suite.java:112)
    at cucumber.runtime.junit.ExamplesRunner.<init>(ExamplesRunner.java:19)
    at cucumber.runtime.junit.ScenarioOutlineRunner.<init>(ScenarioOutlineRunner.java:21)
    at cucumber.runtime.junit.FeatureRunner.buildFeatureElementRunners(FeatureRunner.java:81)
    ... 21 more

JUnit 4.12 now applies some validators when creating runners. It fails with Cucumber because cucumber.runtime.junit.ExamplesRunner is not public.

@aslakhellesoy
Copy link
Contributor

Ugh. Could you send a pull request please?

vanackej pushed a commit to vanackej/cucumber-jvm that referenced this issue Oct 30, 2014
@vanackej
Copy link
Author

#793 Pull request done. The Travis build failed on tests that where already failing before. I ran tests locally with JUnit 4.11 and JUnit 4.12 and didn't see any regression.

vanackej pushed a commit to vanackej/cucumber-jvm that referenced this issue Oct 30, 2014
vanackej pushed a commit to vanackej/cucumber-jvm that referenced this issue Oct 30, 2014
@nhajratw
Copy link
Contributor

any updates on this .. JUnit 4.12 + cuke-jvm 1.2.0 is failing for me with the same error described above.

@aslakhellesoy
Copy link
Contributor

@nhajratw I don't know if we have a quality pull request yet.

@vanackej
Copy link
Author

I have done a pull request here : #794
Tests are OK.
I just have to update to JUnit 4.12 release version.
@aslakhellesoy : was the pull request ok for you ?

@vanackej
Copy link
Author

Pull request updated with release version

@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants