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.
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
Run build htmlunit-tests to execute all html the unit functional
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.
- 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!