Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0.0Release
-
Fix Version/s: 2.0.1Release
-
Component/s: Testing, Running, Debugging
-
Labels:None
-
Environment:Windows XP, Eclipse 3.5 20090920-1017, Groovy Eclipse plugin 2.0.0.xx-20100115-0900-e35-RELEASE
-
Number of attachments :
Description
When I create the following simple groovy test case
class ExampleTest extends GroovyTestCase { public void testSomething() { assert 3 + 2 == 4 } }
and I want to run it with Debug As -> JUnit Test in Eclipse I get the following error:
java.lang.NoClassDefFoundError: org/codehaus/groovy/transform/powerassert/ValueRecorder at com.troii.groovytest.ExampleTest.testSomething(ExampleTest.groovy:8) 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 junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.transform.powerassert.ValueRecorder 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:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 20 more
This only happens if I set the Groovy compiler to 1.6 - when I switch to 1.7 it works
I am having this problem with my Grails 1.2.1 application too which includes groovy 1.6.7
Did you do a full recompile after switching from 1.7 to 1.6? ValueRecorder being a 1.7 class won't be found on 1.6 - but it shouldn't be getting looked for if the compilation has been done by 1.6. Also, the groovy library dependency within the project is groovy-all-1.6 is it? and not still 1.7? We should probably be forcing a recompile on version switching.