Hi Jari,

----- Original Message -----
From: "Jari Worsley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 9:23 AM
Subject: Re: Ideas for Cactus 1.2 and 2.0 roadmap ?


> Assuming that Cactus is to be the place for server side testing tools,
> either for in container or mock tests then:
>
> Ideas for later versions
>
> - help for server side testing of the struts framework, e.g. for testing
> Actions, ActionMappings etc. How are they testing struts btw. ?

Yes, that's a good idea. I have thought about it already and I have 2 ideas
:
- provide some mock implementations objects to help unit test struts. We
would put these mock objects in a package like
org.apache.commons.cactus.extension.struts or something alike and users
would be able to use them in their testXXX() methods,
or
- provide some factory helper classes that return *real* instances of struts
objects (like ActionMapping, ...). In the current version of Cactus, if you
want to unit test, say an Action that you have written, you would need to
manually instanciate an ActionMapping, ActionForm, ... So you need to write
about 10-15 lines of code to create these objects. The goal would be to
replace this code by some helper classes that return these live objects. It
seems Struts is well written and it would be easy to create real instances
of objects and initialize them the way we want for the test. However, if it
is not possible then we'll have to revert to option 1, i.e. provide mock
objects which is also fine.

> - haven't tried the JSP redirector yet, but I imagine there's mroe to be
> done there - like more help with testing custom tag libraries?
>

Yes, implementation of unit testing of tag libraries is not finished yet.
For the moment we can only test tag libraries that extend TagSupport but not
tag libraires that extend TagBodySupport. We'll have to provide this ...

>
> When testing something that takes some XML, say an Element, is there an
> easy way of testing ? I have had problems with JUnit and using XML
> trying to create XML documents.
>

You mean creating a DOM structure prior to calling a method that accept an
Element object for instance ? Yes, why not, we could put this in the util
package.

> Jari
>

Thanks a lot Jari for these good ideas. I'm going to formalize all these
ideas and the ones I've had in a Roadmap document that will be on the Cactus
web site so that we have a clearer idea of what we put in version 1.2 and in
subsequent versions (same as they do it on the struts web page). We'll
update the status of each item as they are completed and will release the
version when all items are completed.

Cheers,
Vincent

Reply via email to