You have been charged with the crime of not testing your code! How do you plead? Will anyone Testify in your defense?

Tapestry Testify is an extension to Apache Tapestry that allows you to write page and component tests very easily and have them run very efficiently.

Please send feedback to the Tapestry user mailing list or raise issues in the project ticket system

Also see the Tapestry-XPath project - using XPath can considerably simplify assertions about your pages.

Why Testify?

Tapestry's PageTester class provides great functionality for testing pages and components. However, when I started using it in anger I ran into several problems. I was using it to unit test my components but there was no convenient way to control what was injected into the components on a test-by-test basis. I tried writing different IOC Modules for different tests but that was clunky; even worse it meant that I had to instantiate lots of PageTester objects and they are slow and I seemed to need a lot of heap over time.

I was coming to the conclusion that unit testing was the wrong approach and instead I should think of the tests as an integration test - in other words all the tests sharing a single PageTester and IOC registry - with that registry containing a fairly complete application. However, this approach can make testing of some components and some behaviours tricky - particularly because you can't use mock objects - and, for me, had the major disadvantage of requiring me to instantiate a large Spring application context in order to provide most of the services - this is very slow and so would make Test-Driven Development on pages/components impractical.

So I wrote Tapestry Testify to address all these problems; to make unit and integration testing extremely simple, to make tests run very efficiently and to make TDD practical for Tapestry.