On Mon, 4 Aug 2003, Mark Leicester wrote:

> Hi,
>
> I'd like to get your comments on the approach to Unit testing I have used in
> developing my Cocoon components. I think that this approach can be extended
> to provide unit tests for all Cocoon components - and I'd like to help write
> these. For example, as Cocoon depends on many other projects it would be
> great to have a suite of tests that we can automatically run to test new
> versions of these other components. We could take the guesswork out of
> testing new versions of Xalan/XSLTC!
>
> 2. Some cocoon helper classes I have created to help with unit testing.
> These classes implement various cocoon environment interfaces. In
> org.apache.cocoon.test.components there is a CocoonComponentManager, and in
> org.apache.cocoon.test.environment there is a CocoonRequest, a CocoonSession
> and a CocoonSourceResolver. These classes exist to make life easier when you
> are instantiating and setting up components intended for use in Cocoon
> outside of the Cocoon environment (e.g. in the Eclipse debug environment).

Have you take a look into
src/test/org/apache/cocoon/AbstractCompositeTestCase.java

It is an abstract testcase for testing action generator and transformers,
builds a almost complete enviroment with the mock classes within
src/test/org/apache/cocoon/environment/mock

Stephan.

Reply via email to