Priority
Major
Type
Bug 
State
Fixed 
Assignee
Alexey Kudravtsev 
Subsystem
Unit Testing. JUnit 
Affected versions
Fixed in
Fixed in build
Next build 
Build
6180
Fixed in build
7051
Severity
0
  • Submitted by   Weiqi Gao
    2 years ago (31 Mar 2007 01:10)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:44)
  • Jira: IDEA-37952
    (history, comments)

IDEA-37952

Trouble running JUnit 4.3.1 tests in IDEA 6.0.5

6
When I attempt to run a JUnit 4.3.1 test in IDEA 6.0.5, I get the following error message in the output window:

"C:\Program Files\Java\jdk1.5.0_11\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 6.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.5.0_11\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\jce.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\rt.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\sunpkcs11.jar;U:\temp\src\java\nio\tclasses;U:\temp\src\java\nio\classes;C:\opt\junit4.3.1\junit-4.3.1.jar;C:\Program Files\JetBrains\IntelliJ IDEA 6.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 PipeTest,testPipe
Exception in thread "main" java.lang.NoSuchMethodError: org.junit.internal.runners.MethodValidator.validateAllMethods()Ljava/til/ist;
at com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:39)
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:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


Process finished with exit code 1

Environment: Windows XP Pro SP2
JDK 1.5.0_11

Issue was resolved
Comments (9)
 
History (1)
 
Links
 
Stephen Scaringi
  Stephen Scaringi
27 Jun 2007 00:24
(2 years ago)
#permalink
This also occurs in Selena build 7027. Yuk.

  • Stephen
David Beutel
  David Beutel
28 Jun 2007 05:30
(2 years ago)
#permalink
I can run all the tests in a class, but get this problem running an individual test. I hope this will be fixed in 7.0M1 as well. Running tests is fundamental for me.
Stephen Scaringi
  Stephen Scaringi
28 Jun 2007 18:11
(2 years ago)
#permalink
As a work around, if you down grade to JUnit 4.1, you'll be able to run individual unit tests again.

  • Stephen
David Beutel
  David Beutel
28 Jun 2007 22:13
(2 years ago)
#permalink
Thanks for the work-around. I probably can't use it, though, because I just joined this project and my employer's official IDE is Eclipse, so I can't tell my co-worker that I need to downgrade JUnit because of a limitation of IDEA. However, Ant 1.7.0 seems to be having a different problem with this JUnit, so I'll see if downgrading would help Ant too.
David Beutel
  David Beutel
30 Jun 2007 05:57
(2 years ago)
#permalink
It looks like IntelliJ's Junit4TestMethodAdapter is calling an internal JUnit method that existed in 4.1 but does not exist in 4.3.1. I guess the IntelliJ source is not available, so I can't look into it.
Taras Tielkes
  Taras Tielkes
30 Jun 2007 13:50
(2 years ago)
#permalink
IIRC, the source for th junit plugin used to be available. However, it seems to be missing from the latest plugin devkit.
David Beutel
  David Beutel
03 Jul 2007 06:03
(2 years ago)
#permalink
Downgrading JUnit does not help Ant, by the way. Ant's problem is pretty small, though. By design, JUnit 4 runs the @After methods even when the @Before methods throw an exception. All the stack traces go into the junitreport for that test method (which is good). The small problem is that the report counts them all as errors, so the error count can be higher than the test count (resulting in a negative success rate). (This count problem might be because of the way Ant's JUnitTestRunner second-guesses JUnit 4 to simulate a JUnit-3-like distinction between errors and failures.) So I have no excuse for not using JUnit 4.3.1.
Nat
  Nat
05 Jul 2007 16:52
(2 years ago)
#permalink
Can you also check the problem when running JUnit using @Test annotation. It seems that when you run individual @Test annotated method, JUnit Runner in Intellij will run all the unit tests in that class anyway.
Alexey Kudravtsev
  Alexey Kudravtsev
05 Jul 2007 17:04
(2 years ago)
#permalink
Nat - cannot reproduce it here. Could you please create separate JIRA issue and attach the sample project there?