Copasetic Groovy Eclipse plug-in fix
The latest version of the Groovy plug-in for Eclipse is broken in CVS. It doesn’t compile and once it does, you can’t make GroovyTestCases or normal JUnit tests either.
If you want to be groovy with Groovy in Eclipse, you’ll need to follow the instructions on the Groovy site and do the following additional trippn’ tasks:
- In the class
org.codehaus.groovy.eclipse.editor.GroovyConfigurationdelete theorg.codehaus.groovy.eclipse.editor.GroovySourceViewerConfiguration.Hoverimport. - In the class
org.codehaus.groovy.eclipse.model.GroovyProjectfix the methodisTestCaseClassto use thegetSuperClassNode()method instead of thegetSuperClass()one, like this:private boolean isTestCaseClass(ClassNode classNode) { ClassNode parent = classNode.getSuperClassNode(); while (parent != null) { if (parent.getNameWithoutPackage().equals("TestCase")) { return true; } parent = parent.getSuperClassNode(); } return false; } - Edit the
plugin.xmlfile to include<import plugin="org.junit"/>in the<requires>section.
Export the plug-in and you should be good to go disco dancing (or at least Groovy programmin’).
| Related odds and ends | ||
|---|---|---|
Saturday 18 Feb 2006 | Dynamic Languages, Groovy
I’m down man. Thanks for the post. I tried to work through this a few weeks back but didn’t pick up on missing import in the plugin.xml.
However…
Isn’t Groovy a waste of time? I’ve read a few scathing blog posts about the progress of Groovy development. Is the fact that it is a JSR enough to expect that the language will survive and be useful in the long term? I’d love to get into using “dynamic languages” for testing. But I’m unsure which one to use? Do you have any opinions about Jython as a language for rapid test development?
Groovy is still young- it got a lot of press too early it seems. Jython, Python, and Ruby have been around for years and have had plenty of time to mature.
Jython is a fun language to develop in. It’s Python based, so the learning curve is slightly steeper than that of Groovy. Check out the PyDev Eclipse plug-in- this is how the Groovy one should act someday. I suspect you’ll see more tool development for Groovy once the language itself matures.