WARNING: you are not looking at the live version but at an older version.

CoUnit

Introduction

CoUnit is a unit testing framework for Cocoon applications.
It can be used to specify and execute unit tests for pipelines and stylesheets.

CoUnit is not meant for testing components written in Java; we have JUnit for that. It will also not help to test the web-frontend of your application; HttpUnit does a fine job in that realm. CoUnit helps you to test the bits in between: All the code that lives in the pipelines, transforming XML (SAX events). At the moment, it is particularly good at testing XSLT stylesheets, but Flowscript is not yet covered.

CoUnit can be used with Cocoon 2.1.6 and higher. If you need to use an earlier version of Cocoon, you will need to retrofit the MountTableTransformer from the Cocoon repository after 11 October 2004.

Unit testing, and test-driven development

Unit (and regression) testing has been one of the best practices in software development for a long time (I first came acress it in an article in Dr. Dobbs Journal , February 1997). More recently it has become popular as part of the eXtreme Programming method, where it has evolved into test-driven development. There are many good books and web sites about unit testing, which you should have a look at if you have never heard about these methods:

  • JUnit - dedicated to software developers using JUnit or one of the other XUnit testing frameworks.
  • TestDriven - promoting techniques, tools, and general good will in the test-driven community.
  • Test Driven Development - a page at objectmentor.com

Project resources

Frequently asked questions

Q: I get a NullPointerException trying to run unit tests, even those that come with CoUnit.
A: You need to update Cocoon to version 2.1.6 or higher, or at least update the MountTableTransformer to a version later than 11 October 2004.

Comments (1)