O'Reilly logo

Programming Groovy 2 by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit Testing Java and Groovy Code

Thanks to excellent Java-Groovy integration, we can use any Java-based testing framework and mock-objects framework (such as EasyMock, JMock, and Mockito), with Groovy. We’re not limited to those, however. When we install Groovy, we automatically get a unit-testing framework built on JUnit. We can use it to test any code on the Java Virtual Machine—our Java code, our Groovy code, and so on. We simply extend our test class from GroovyTestCase and implement our test methods, and we’re all set to run our tests.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required