jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Using Cactus with WebWork
Date Sun, 04 Aug 2002 19:48:51 GMT
If you make some progress on the subject, could you post back - We could
add a Howto page on Cactus web page to explain how to do this ... :-)

Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: 04 August 2002 20:44
> To: 'Cactus Users List'
> Cc: 'Patrick Lightbody'
> Subject: RE: Using Cactus with WebWork
> 
> Hi Patrick,
> 
> I have not done it and I have never used webwork (Actually I just
> noticed it is now a subproject of opensymphony. Congratulations!).
> 
> Ok, I've just had a very quick look at webwork.
> 
> I guess it all depends what you want to test. I can see several
> possibilities :
> 
> 1/ test your action. You do not need Cactus for that as the Actions
are
> pure java beans that you can test directly from JUnit easily (using a
> Mock Objects approach if need be).
> 
> 2/ test integration of your action in the container, to ensure that
> everything is set up correctly for example.
> 
> For 2/, Cactus needs to control the server side, thus you would have
to
> do something like the following in your testXXX() :
> 
> public void testXXX()
> {
>    ServletDispatcher dispatcher = new ServletDispatcher();
>    dispatcher.init(config);
> 
>    // Start web work
>    dispatcher.service(request, response);
> 
>    // Get a handle on your action
>    Action action = ActionFactory.getAction("your action name");
> 
>    // Perform asserts on your action
>    asssertEquals("xxx", action.getXXX());
> }
> 
> Note: You need to define all the parameters needed by
ServletDispatcher
> on the Cactus ServeltRedirector in your web.xml.
> 
> Would that do the trick for you ?
> 
> Hope it helps (again I have just learned WebWork in 15 minutes by
> looking at the ServletDispatcher code so I'm may be completely of the
> mark!).
> 
> Thanks
> -Vincent
> 
> 
> > -----Original Message-----
> > From: Patrick Lightbody [mailto:plightbo@hotmail.com]
> > Sent: 30 July 2002 13:45
> > To: cactus-user@jakarta.apache.org
> > Subject: Using Cactus with WebWork
> >
> > Has anyone used Cactus with WebWork? I'd like to be able to have the
> > container execute my WW actions and then somehow check the getXxx
> methods
> > in
> > my actions for valid data. Has anyone done this?
> >
> > -Pat
> >
> > --
> > To unsubscribe, e-mail:   <mailto:cactus-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:cactus-user-
> > help@jakarta.apache.org>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message