JSP as integration testing glue July 25, 2008Posted by javafoo in j2ee, java, java http, javanotes.
As part of one of our new projects, a team mate and I are working on two different areas of the project. This other team mate is responsible for writing the integration glue code that uses all the components that I am writing. But he is not ready yet and I will be on vacation when he is ready. Of course I have unit tests to test my parts. But I want to test the integration part of it. I can do this the boring way: write a Junit that sets up all the test data and almost end up writing very complex tests to integrate all my components. The more fun way is to write JSPs to do all the integration tests, the JSP can act as a loose test glue script. And I am building the JSPs in such a way that I can stop and view the results at each integration point, before moving on to the next one. It’s visual and fun. And I have managed to catch quite some bugs. I wonder why I haven’t thought of looking at JSPs this way.