cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: Q: testing (hopefully test-driving development) with Cocoon
Date Mon, 16 May 2005 08:48:11 GMT
Le 16 mai 05, à 10:34, Wojciech Biela a écrit :

> On 5/12/05, Ralph Goers <> wrote:
>> Did you know you can write your flow in Java?
> yes I heared of it, but I see the mainstream for flow in Cocoon is
> JavaScript so I assume for some reason it's preffered to use it (but
> then problem is unit testing arise), am I wrong?

Yes, javascript-based flow is the recommended way, javaflow is stil 
"officially" considered experimental (but AFAIK very usable and stable 

For unit testing flowscript, I'd use an HTTP-based method, which allows 
you to test the full request processing chain "in situ".

You're right that unit testing flowscript directly could be useful, but 
I don't think we have examples of doing it in Cocoon currently. If 
you'd like to try and create something for this, there are several 
examples of JUnit testing of Cocoon components in the codebase, which 
should be a good base to start from.

To test my custom Cocoon components in their environment, I've been 
using a custom JUnitGenerator, which executes JUnit tests in the same 
environment than my production components (database configs etc) and 
outputs the results in XML. I forgot to mention this when we talked 
last week after your comment on my weblog.

It's fairly rough and probably not general, but if you'd like to 
improve it I could post the code on the wiki as an example. I don't 
think it would help much about flowscript testing but it could give you 
some ideas.


View raw message