jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject RE: Cactus or JUnit
Date Wed, 24 Mar 2004 16:34:32 GMT
Look at using a Mock object for your request and response objects..  If you
look at some of the test code in the Turbine 2 CVS, there are examples..

Basically, if you are testing how your app integrates with a container, or
maybe looking at how your code works with filters etc then Cactus is what
you need.  However, if you assume that the request and response are pretty
simple, and you don't need to start up an app server or something to get
config data, then go with Junit...

If your object that you want to test just needs a request/response to pass
some values in and out, maybe you could refactor your object so it doesn't
need the request/response objects?

Eric

> -----Original Message-----
> From: Brian Ivey [mailto:cbivey@comcast.net]
> Sent: Wednesday, March 24, 2004 3:08 PM
> To: Cactus Users List
> Subject: RE: Cactus or JUnit
>
>
> Actually the object does require a request and response object.  Does this
> mean JUnit is not the best option?  If yes, then what should I use?
>
> Thanks again,
> Brian Ivey
>
> -----Original Message-----
> From: David Plass [mailto:DPlass@TCICREDIT.COM]
> Sent: Wednesday, March 24, 2004 10:04 AM
> To: Cactus Users List
> Subject: RE: Cactus or JUnit
>
>
> Yes, I'd agree.  If your server-side object can be instantiated
> outside the
> server (i.e., not an EJB), and it doesn't require session/request/response
> objects, by all means, use Junit.
>
> "Use the simplest test framework that works".
>
> Thanks
> --DP
>
>
> -----Original Message-----
> From: Brian Ivey [mailto:cbivey@comcast.net]
> Sent: Wednesday, March 24, 2004 9:30 AM
> To: Cactus Users - List
> Subject: Cactus or JUnit
>
>
> I am new to Cactus, JUnit, and StrutsTestCase.  In fact, this is the first
> time I've attempted to perform any structured testing.  I've successfully
> written some Struts test cases.
>
> My question is basically one of design.  I am trying to test a server side
> object that is neither a Servlet, JSP, or EJB.    It contains no Struts
> code.  It just contains an algorithm for building an HTML menu.  My first
> guess is that JUnit should be used.  Would anyone agree with this?
>
> Also, in the application I am testing Session IDs need to be
> passed between
> pages.  Is there a best practice for storing this in my testing
> package for
> reuse among the different test cases?
>
> Thanks,
> Brian Ivey
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org


Mime
View raw message