specify Grails tests configuration
Hi,
Whenever I run my grails tests I get a popup menu titled "Choose configuration type to run", that allows me to choose whether to run these tests as Grails or JUnit tests. However, I have one Grails test class that is always run as a JUnit test, without providing me with an option to run it as a Grails test. This test class is different from the others insofar as it extends grails.test.WebFlowTestCase, rather than GroovyTestCase (or one of it's descendants).
Is there any way that I can indicate to IntelliJ that I want this class to be run as a Grails test? Alternatively, can I specify a project-wide default, which will force all tests to be run as Grails tests?
Thanks,
Don
Please sign in to leave a comment.
Now there's no way. This will work in 8.1.4 and next Maia EAPs (after M1).
Thanks Peter,
Do you know why my test that is a subclass of extends grails.test.WebFlowTestCase is run as a Java test, even though it's obviously a Grails test? More importantly, is there any way I can change this?
- Don
Yes, I know. It's just that GroovyTestCase is hardcoded as a should-be
superclass for Grails test candidates. The fix consists of replacing it
with TestCase.
It would be great if there were some way to specify on a per-project (or per-module) basis, to always run the tests as Grails tests. If you have a project which only has Grails tests, having to select Grails from the pop-up menu every time you run a test quickly becomes annoying.
Thanks,
Don
Sounds reasonable. In fact, integration tests should probably always be
run as Grails tests. As for unit tests, I see only one JUnit advantage,
it starts faster, doesn't have to load the Spring container. Question
is, how to organize it in GUI. Another option in Groovy/Grails facet
makes me sad :(
I don't think Grails unit tests do load the Spring container. There's certainly no dependency injection when running Grails unit tests and they run pretty quickly, so I'm not sure there's really any advantage to providing an option to run as JUnit instead.
As it's a setting, why not just put in somewhere in the Settings dialog?
http://www.jetbrains.net/jira/browse/IDEADEV-38202