cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: [RT] Unit testing and CocoonUnit
Date Fri, 07 Nov 2003 07:36:39 GMT
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:serialize type="xml"/>

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.


View raw message