Monday, January 21, 2008

trying to fix grails groovy tests in grails apps

Most of the grails test-app test fail with some odd problems about not being able to find some of the domain classes. The problems view in eclipse says stuff like

Unbound classpath variable: 'GRAILS_HOME/ant/lib/ant.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693560 24138
...
Unbound classpath variable: 'GRAILS_HOME/dist/grails-core-1.0-RC1.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693576 24197

When upgrading the groovy plugin I found that I needed testNG so I have added the testNG to my eclipse installation and I could then upgrade the groovy plugin. There's a maven plugin too, and I'll have a look at that too.

So next to fix the Unbound classpath variable problems...

Need to create a variable for GRAILS_HOME and point it to the latest grails version.

Setting the GRAILS_HOME only worked if I had also upgraded he project to RC-4. Have to test this with another app to be sure.

One weird thing is that dozens of .class files get build and put into the root folder. Messy. These are definately created by the eclipse build. If you delete them and then do a clean you get them regenerated.

Also seem to need to configure the .classpath so that all the class files go somewhere other than the root folder...

No comments: