Thursday, October 22, 2009

Groovy and Grails Testing Methods

Hello Friends,

I would like to share a brief note about us in the beginning of the post. We are Chicago based Groovy and Grails Consultant working on Groovy and Grails development. To-day, I am going to share few thoughts about the concepts of testing in the Grails.

Grails supports the following concept of testing,
1. Unit testing – As the name suggest that testing a particular part of code or code block without considering surrounding infrastructure. There are several mock methods available for this, few of them are, Groovy Mock or ExpandoMetaClass. Alternatively, you could using the Testing plugin.

2. Integration testing - Grails uses a for integration tests and clear out all the data from the database in between each test.

3. Functional testing – As the name suggest, it includes the testing of the actual running application. Functional testing can be done using Canoo WebTest plug-in.


Now, Testing just not stops here, One needs to test all layers of testing in Grails. There are few things to consider while testing the layers.

- For testing the domain entities one need to write the unit tests to check the validation process.
- For testing the various services, one needs to write the unit and integration test to make sure that all services are running.
- For testing the controllers, one needs to write the unit and integration tests to make sure that controllers are working as needed.

Bookmark and Share

0 comments: