Hi Upayavira,

This looks real good, having a specialized testing framework will certainly help improving our test traceability!

I just have one small thing to add:

...CocoonUnit would use the CocoonBean to pass requests to Cocoon. The bean would prepare an Environment (maybe even an HTTPEnvironment), and would place an empty ArrayList into the object model with a key of UNIT_TEST_XML...

Instead of an ArrayList you might want to put a custom object there (CocoonUnitContext?), for example to allow the testing code to specify options later on, like "don't store steps 1 and 4 of the pipeline".


...Conclusion
----------
Unit testing helps to provide reliable code. Unit testing in a Web environment is not always straightforward as your 'units' aren't always clearly defined. With Cocoon, however, stages in a pipeline can be considered to be 'units', and therefore could be tested independently of each other. Adding a CocoonUnit to the Cocoon codebase would further extend Cocoon's ability to be used in substantial web environments where automated testing is crucial to success.

+1000


What do you all think?

+1000 again!


-Bertrand

Reply via email to