Difference between revisions of "Using Groovy in Testing"

From CitconWiki
Jump to navigationJump to search
(New page: The bulk of the session introduced the Groovy language. Benefits of using Groovy for writing developer tests were summarised as: * test code shorter and sweeter (than Java) * interactiv...)
(No difference)

Revision as of 02:46, 30 June 2008

The bulk of the session introduced the Groovy language.

Benefits of using Groovy for writing developer tests were summarised as:

  • test code shorter and sweeter (than Java)
  • interactive shell
  • JUnit 4 support including Theories
  • TestNG support
  • full Java library support
  • built-in support for parsing XML
  • JUnit 3.8 built-in
  • powerful assertion capability built-in to Groovy (though for JUnit4 assertions, you need to use static imports)
  • built-in mocking easy to use (with maps or expandos)
  • Groovy's fun!!

To use as a JUnit test, the simplest way is to extend GroovyTestCase. With the Groovy plugins installed, you can use Groovy JUnits in the same way as Java JUnits.