Groovy JUnit test support

Posted by Martin Janicek on Oracle Blogs See other posts from Oracle Blogs or by Martin Janicek
Published on Tue, 28 Aug 2012 13:36:17 +0000 Indexed on 2012/08/28 15:45 UTC
Read the original article Hit count: 249

Filed under:

Good news everyone!

I've implemented support for the Groovy JUnit tests which basically means you can finally use Groovy in the area where is so highly productive! You can create a new Groovy JUnit test in the New File/Groovy/Groovy JUnit test and it should behave in the same way as for Java tests. Which means if there is no JUnit setup in your project yet, you can choose between JUnit 3 and JUnit 4 template and with respect to your choice the project settings will be changed (in case of the Maven based projects the correct dependencies and plugins are added to the pom.xml and in case of the Ant based project the JUnit dependency is configured). Or if the project is already configured, the correct template will be used. After that the test skeleton is created and you can write your own code and of course run the tests together with the java ones.

Some of you were asking for this feature and of course I don't expect it will be perfect from the beginning so I would be really glad to see some constructive feedback about what could be improved and/or redesigned ;] ..at the end I have to say that the feature is not active for the Ant based Java EE projects yet (I'm aware of it and it will be fixed to the NetBeans 7.3 final - actually it will be done in a few days/weeks, just want you to know). But it's already complete in all types of the Maven based projects and also for the Ant based J2SE projects.

And as always, the daily build where you can try the feature can be downloaded right here, so don't hesitate to try it!

© Oracle Blogs or respective owner

Related posts about /Features