Grails : Unit Testing
This page last changed on Feb 28, 2006 by glaforge.
Unit testingCreating & Running a test suiteTo create a test suite run the "grails create-test-suite" target or just create a new class in "%PROJECT_HOME%\grails-test" that extends GroovyTestCase and ends with "Tests".
Below is an example of a test suite that tests the validate method on a domain class: class BookTests { def testValid() { def b = new Book(title:"Groovy in Action", author:"Dierk Koenig") assert b.validate() } } To run the test suite run the command "grails test-app" |
![]() |
Document generated by Confluence on Mar 29, 2006 08:46 |