JUnit 4.5 with IDEA 8.0M1 not working?
I've been trying to use JUnit 4.5 in IDEA 8.0M1 but keep running into the
following exception when I run my test case:
Exception in thread "main" java.lang.NoClassDefFoundError:
org.junit.internal.runners.TestClassRunner
at
com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:42)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22)
I looked in the JUnit 4.5 JAR and indeed that class does not exist.
This is the first time using JUnit 4.x so I want to make sure I'm not doing
something wrong :)
Thanks!
Grant
Please sign in to leave a comment.
I'm getting the same thing. Here are the various configurations and the results:
- JUnit 4.4 in IDEA 8.0M1 - works ok
- JUnit 4.5 in 7.0.4 - works ok
- JUnit 4.5 in 8.0M1 - get NoClassDefFoundError
Mark --
Thanks for the testing. At least I know I'm not crazy :)
-Grant
"Mark Vedder" <no_reply@jetbrains.com> wrote in message
news:22756174.47101219168926467.JavaMail.jive@app4.labs.intellij.net...
>>
>> I've been trying to use JUnit 4.5 in IDEA 8.0M1 but keep running into the
>> following exception when I run my test case:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org.junit.internal.runners.TestClassRunner
>> at
>> com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:42)
>> at junit.textui.TestRunner.doRun(TestRunner.java:116)
>> at
>> com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
>> at junit.textui.TestRunner.doRun(TestRunner.java:109)
>> at
>> com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22)
>>
>> I looked in the JUnit 4.5 JAR and indeed that class does not exist.
>>
>> This is the first time using JUnit 4.x so I want to make sure I'm not
>> doing
>> something wrong :)
>>
>> Thanks!
>> Grant
>>
>
When I ran a previous test in 7.0.4 with JUnit 4.5 - it ran fine. It was both a test I had run before and one that existed in my IDEA run configurations. When I just created a new JUnit test in 7.0.4 and tried to run it using JUnit 4.5, I received an error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/unit/nternal/unners/estClassRunner
at com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:38)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.ClassNotFoundException: org.junit.internal.runners.TestClassRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 12 more
Interesting...
http://www.jetbrains.net/jira/browse/IDEA-19241
"Mark Vedder" <no_reply@jetbrains.com> wrote in message
news:17967976.47461219174288845.JavaMail.jive@app4.labs.intellij.net...
>
>