开发者

What is the convention for Java unit tests in a Grails project?

开发者 https://www.devze.com 2023-01-29 01:33 出处:网络
I am creating a new Grails project that uses some Java code to do some of the开发者_C百科 \"core\" processing.The java code will go in [project-home]/src/java.Where should the unit tests for this Java

I am creating a new Grails project that uses some Java code to do some of the开发者_C百科 "core" processing. The java code will go in [project-home]/src/java. Where should the unit tests for this Java classes go? [project-home]/test/unit, intermingled with the groovy unit tests? What is the convention for this scenario?

Thanks in advance,

Yvon


I do not believe that you will gain anything by segregating tests on your java code from tests on your groovy code. Most likely, testing pure-java classes in a grails application will imply mocking your domain and other services (sometimes grails services). It is more convenient to test them in a GrailsUnitTestCase, all under unit/test

Regards,

Vincent Giguère

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号