Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.5.1
-
Component/s: None
-
Labels:None
-
Environment:Eclipse 3.3
-
Number of attachments :
Description
There are multiple problems:
1. static imports are not supported :
import static org.junit.Assert.assertEquals throws an error in the editor
2. A NPE occurs in org.codehaus.groovy.eclipse.junit.launcher.JUnit4TestFinder.annotates(IMember):
String source = member.getSource().substring(0, charsToSearch);
Here are member.geSource() null. The reason seams to be that the member always is a BinaryType or BinaryMethod. Both hasn't a Source.
3. After fixing this with this and analyze the Tetsclass if there are @Test - Annotations the Testclass was executed. But the result was:
java.lang.Exception: No runnable methods
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:33)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
This is actually a larger issue that I've finally tracked down. This occurs outside of Eclipse. It appears that groovyc is not actually compiling in any annotations. I'll open another issue to address this, but I would assume that this issue has been fixed in the latest trunk, but is still busted in RC1.