No testing within JetGroovy???

begin rant

I must be missing something. If I can't run a test that uses GORM et all from within Idea, whats the point? Do people really develop in grails using a text editor and a command line for running tests? Without the fast testing cycle, no amount of groovyness will improve my productivity.

How do others develop test-first with grails? Do you?

end rant

3 comments
Comment actions Permalink

I found some interesting classes in the grails source (which are not included in the distributions):

- AbstractGrailsMockTests
- AbstractGrailsIntegrationTests
- AbstractGrailsIntegrationTests

Grails uses these classes in some of its own tests. However they appear only to work if executed via "grails test-app", so I need to find what the test-runner script is doing. I'm going to try to use these classes as is, but I'm not sure that will be possible. But in any case, not changes should be required to JetGroovy.

0
Comment actions Permalink

You can run the tests within IDEA by editing your run/debug configurations and adding a new 'Grails Application' and selecting 'Run Tests' for the Configuration Type. I haven't figured out how to run a single test or how to run a test from within the context menu. Maybe someone else knows how to do this?

0
Comment actions Permalink

Like you said, that runs /all/ the tests. In fact, those actions simply spawn off a process that invokes the gant scripts, and is equivalent to "grails test-app", etc. This fires up a complete grails application (or nearly), recompiles everything from source, and runs /all/ tests. This does not in any way support TDD development.

However, I am pretty close to a JUnit4TestRunner that fires up a very lightweight instance of grails suitable for rapid testing. One of the last steps, which I'm working on now, is to use a -javaagent to ASM inject the Domain artefacts so GORMized classes can also be tested.

Stay tuned.

0

Please sign in to leave a comment.