Using Groovy in Testing

From CitconWiki
Revision as of 02:46, 30 June 2008 by 203.97.252.87 (talk) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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.