cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: [RT] Unit testing and CocoonUnit
Date Fri, 07 Nov 2003 09:52:09 GMT
Bertrand Delacretaz wrote:

> Le Vendredi, 7 nov 2003, à 08:17 Europe/Zurich, Upayavira a écrit :
>> ...3) The remaining thing I dislike is the need to have some code in 
>> the sitemap to accept the requests from CocoonUnit)
>> Thinking wildly about point 3, maybe I could write a unit test 
>> servlet and set it up in web.xml to answer requests to /cocoon-unit. 
>> Then you wouldn't need code in your sitemap. Hmm....
> Why not use sitemap definitions to let CocoonUnitClient (HttpUnit 
> extension) talk to CocoonUnitServer (Cocoon Generator)?
> <map:match pattern="/CocoonUnitControl/*/*">
>   <map:generate type="cocoon-unit">
>     <map:parameter name="test-context-id" value="{1}"/>
>     <map:parameter name="operation" value="{2}"/>
>   </map:generate>
>   <map:serialize type="xml"/>
> </map:match>
> The Generator would then take care of all interactions between the 
> client-side CocoonUnit classes and the server-side instrumentation 
> stuff: creating test contexts, retrieving pipeline stages, etc, in a 
> RESTish way.
> -Bertrand

Yup, that's what I had in mind. But I don't like having to add something 
to the sitemap for testing purposes.

At least I can make the generator return <testing-not-available/> if the 
cocoon-unit-enable is set to off.

Regards, Upayavira

View raw message