Griffon 0.9 sneak peek: testing upgrades
The first thing you'll notice is that executing tests is done in the same way as in Grails. This is because Griffon's build system has been refreshed with the latest Grails 1.3.2 codebase. Now you can run all tests using the same phase:type mechanism that Grails has. Griffon has 3 phases (unit, integration and other) and two default types (unit and integration). Those two types are actually JUnit based tests cases, it has been pointed out that perhaps those types should be coalesced into a single one: junit.
Say you'd like to run all JUnit tests in the unit phase, this is what you must type
griffon test-app :unit
griffon test-app unit:
Back to test-app. this command is very flexible with its options. Do you need to run all tests that affect all services?
griffon test-app *Service
griffon test-app FooController
griffon test-app com.acme.Factory.testMakeAnvil
Following into testing related plugins, there are 4 other direct ports of Grails plugins into Griffon
- Code-Coverage - this one existed since the early days, however it has been synchronized to the latest codebase from its Grails counterpart
- Clover - s/grails/griffon/ did the trick for this one, just like that.
- CodeNarc - static code analysis for Groovy source? you bet!
- GMetrics - measures the size and complexity of your codebase
All in all, Griffon will help you to keep the bar green and bugs in check.
Keep on Groovying!
About Andres Almiray
Andres is a Java/Groovy developer and Java Champion, with more than 11 years of experience in software design and development. He has been involved in web and desktop application developments since the early days of Java. He has also been teacher of computer science courses in the most prestigious education institute in Mexico. His current interests include Groovy and Swing. He is a true believer of open source and has participated in popular projects like Groovy, Griffon, JMatter and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member and current project lead of the Griffon framework. He blogs periodically at http://jroller.com/aalmiray. You can find him on twitter too as @aalmiray. He likes to spend time with his beloved wife, Ixchel, when not hacking around.
More About Andres »NFJS, the Magazine
December Issue Now AvailableBDD and REST
by Brian SlettenMocks and Stubs in Groovy Tests
by Kenneth KousenAlgorithms for Better Text Search Results
by John GriffinKnowns and Unknowns of Scrum and Agile
by Brian Tarbox