apache > cocoon

- Home

# Apache Cocoon Tests

## Overview of testing procedures

There are some initial procedures available for you to ensure that Apache Cocoon can run properly on your particular computing platform and that the components do function properly.

You can build upon this infrastructure to add your own tests, and to ensure that development work proceeds smoothly. The tests are located in the `src/test/` directory.

## JUnit Tests

Run `build junit-test` to conduct an initial set of automated JUnit test cases, e.g. Test various transformers; Test the methods for getting platform-dependent filesystem pathnames; etc.

### How to add more JUnit tests

As there is already a nice junit framework available, it is not that difficult to add junit tests for any transformer. In short:

- Create XYTransformerTestCase.java
- Create XYTransformerTestCase.xconf
- Edit the transformers section in XYTransformerTestCase.xtest for XYTransformerTestCase
- Add testABC() methods to XYTransformerTestCase.java

## htmlunit Tests

Run `build htmlunit-tests` to execute all html the unit functional tests.
This requires running another Cocoon instance, as the htmlunit tests make HTTP requests and check the responses.
Adding more htmlunit tests is easy, see src/test/htmlunit.
The htmlunit tests have not been ported to the 2.2 trunk yet, see Jira issue COCOON-1488.

## Other tests

- Anteater functional tests are still present in 2.1.8 (src/test/anteater), but they will be retired once we have verified that the htmlunit tests cover everything that was previously tested by anteater. `
  `
- Samples web application can be used to perform manual testing. Of course, contributions to automate these tests are welcome!`
  `

Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version (registration required).