jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arkady_B...@vertexinc.com
Subject RE: Advice needed
Date Mon, 01 Apr 2002 22:00:35 GMT

Thanks a lot for your input it was useful.



                                                                                         
                                             
                      "Vincent Massol"                                                   
                                             
                      <vmassol@octo.com        To:       "'Cactus Users List'" <cactus-user@jakarta.apache.org>
                       
                      >                        cc:                                    
                                                
                                               Subject:  RE: Advice needed               
                                             
                      04/01/2002 03:46                                                   
                                             
                      PM                                                                 
                                             
                      Please respond to                                                  
                                             
                      "Cactus Users                                                      
                                             
                      List"                                                              
                                             
                                                                                         
                                             
                                                                                         
                                             




Arkady,

No, if you are simply interested in testing some code logic and you
don't wasn't to test the MVC framework, and this framework shields you
completely from the Servlet API, then I don't think you need Cactus,
especially if you plan to use HttpUnit.

So pure JUnit + HttpUnit should be enough in your case to get a good
confidence your code works (assuming the MVC framework is not buggy of
course :-)).

That said, maybe your logic to test will call some other features of the
container like using a DataSource to access the database or stuff like
this ? Should that be the case, then you would need to use a MockObjects
(http://www.mockobjects.com) approach in your unit tests and test the
real stuff with HttpUnit.

Now we're of course assuming you're not using EJBs (or calling other
servlets) because then you would also need to test them.

-Vincent

> -----Original Message-----
> From: Arkady_Bari@vertexinc.com [mailto:Arkady_Bari@vertexinc.com]
> Sent: 01 April 2002 21:35
> To: Cactus Users List
> Subject: RE: Advice needed
>

[snip]

> Arkady,
>
> Several points :
>
> 1/ Why don't you use an existing Controller framework (Struts,
> Barracuda, WebWork, etc) ? Thus, no need to test it :-)
> That is beyond my control. :). The particular scenario I am interested
> does not actually involve the testing of the framework but rather the
> business
> logic implemented in the eventHandlers that are manipulated by the
> framework.
> Given this do you still see the benefits of using "cactus" for these
event
> handlers
>
> 2/ As your framework is based on servlets it means you still have some
> code that bridges the link between the Servlet API and your framework.
> Don't you want to test this code too ?
> We intend to use HttpUnit for that
>
> 3/ Cactus is more than unit testing framework, it is an integration
unit
> testing framework, in the sense that it lets you ensure that
everything
> works together, in the target *environment(s)*. Thus, if you don't use
> Cactus you would still need to perform some functional tests to ensure
> your framework works. However these tests will not cover as many use
> cases as Cactus can cover (as it is a unit testing framework).
> We also want to use HttpUnit for that but we also want to augument it
with
> cactus.
>
> If you plan to deliver your framework for several servlet engines,
> Cactus is your tool of choice.
>
> That said, it has a steeper learning curve that simple junit as you
need
> to understand webapp deployment for your container. But that's anyway
a
> must. Also, the second drawback is that tests tend to take longer to
> execute than simple junit tests (but that's only if you're counting
your
> container startup time, which you can bypass if you leave it running
and
> use its dynamic reloading features).
>
> Hope it helps
> -Vincent
>
> > -----Original Message-----
> > From: Arkady_Bari@vertexinc.com [mailto:Arkady_Bari@vertexinc.com]
> > Sent: 01 April 2002 20:27
> > To: cactus-user@jakarta.apache.org
> > Subject: Advice needed
> >
> > Hi,
> >
> > We have built in home a servlet framework supporting MVC
architecture.
> Do
> > you see advantage of using "cactus" to test event handlers as oppose
> to
> > simply
> > use junit. Since the controller servlet is responsible for invoking
> the
> > event handler simple junit can simulate the controller by  setting
up
> the
> > handler context and then invoke the handler.handle(...)  method.
> Anything
> > I can gain by using "cactus" ? The only thing I can see that if the
> event
> > handler uses session it would be easier to use "cactus" to set the
> session
> > content.
> >
> >                                                 Thank you
> >
> >                                                             Arkady
> >
> >
> >
> > --
> > 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>
>




--
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