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

0
7 comments

Now there's no way. This will work in 8.1.4 and next Maia EAPs (after M1).

0
Avatar
Permanently deleted user

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

0

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.

0
Avatar
Permanently deleted user

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

0

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 :(

0
Avatar
Permanently deleted user
As for unit tests, I see only one JUnit advantage, it starts faster, doesn't have to load the Spring container.


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.

Question is, how to organize it in GUI

As it's a setting, why not just put in somewhere in the Settings dialog?

0

Please sign in to leave a comment.