cucumber/cucumber-jvm — Issue #230: cucumber-jython's unit test fails
Author: dkowis
Created: 2012-02-29 14:14:43+00:00
State: open
Labels: Jython

Running RunCukesTest in the cucumber-jython project results in this:

```
java.lang.NoClassDefFoundError: com/thoughtworks/xstream/converters/Converter
at cucumber.runtime.Runtime.(Runtime.java:65)
at cucumber.runtime.Runtime.(Runtime.java:55)
at cucumber.runtime.Runtime.(Runtime.java:51)
at cucumber.junit.Cucumber.(Cucumber.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.converters.Converter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 22 more
```

The xstream stuff is a dependency for the Junit things, but it fails with the same error during a mvn install, or when trying to run the unit test from within IDEA. I think perhaps some dependency isn't quite right. In the Junit project it mentions that the xstream stuff is needed for testing, but isn't JarJar'd. Does that mean I need to add an xstream dependency explicitly to the cucumber-jython (and maybe all the others?) in the test scope to prevent this from happening? Perhaps there's a different solution that would be better?