jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EP...@upstate.com
Subject RE: JSP testing, anybody?
Date Tue, 21 Jan 2003 15:43:53 GMT
I still use Cactus though for other types of business logic.  Admittedly, I
think my apps are too coupled to the database, but often I find I need all
those bits of support that the container provides to test my business logic.
How do you use just JUnit?

Good design says your BL should not be in JSP however.  

Eric

-----Original Message-----
From: Olivier Gourment [mailto:ogourment@yahoo.com]
Sent: Tuesday, January 21, 2003 10:45 AM
To: Cactus Users List
Subject: Re: JSP testing, anybody?



I agree that JSP testing is hard, but it also proves useful. If you
design your tests not to be too dependent on the actual HTML content,
then it works. I have used HTTPUnit, not Cactus, for this purpose.

Of course, it doesn't mean that you should put code in JSPs.

    Olivier


--- Brian Coyner <guitarman_151@yahoo.com> wrote:
> It's my opinion that testing JSPs is too hard, and therefore any
> critical logic
> in a JSP should be refactored to a standalone helper class. These
> helper
> classes can then be tested using JUnit (no need for Cactus). If you
> find
> yourself putting business logic into a JSP then you need to stop and
> refactor
> your code.
> 
> Brian 
> 
> 
> --- "Frank J. Buono" <Frank.Buono@ExceptionalSoftware.com> wrote:
> > All:
> > Has anybody had any luck testing JSP's with Catus/WebLogic 
> > per the suggested idea in the "Jsp Howto"(See Below)?
> > Frank
> >  
> > public class MyTest extends ServletTestCase
> > {
> >     [...]
> >     
> >     public void testXXX()
> >     {
> >         RequestDispatcher rd = theConfig.getServletContext().
> >             getRequestDispatcher("/path/to/test.jsp");
> >         rd.forward(theRequest, theResponse);
> >     }
> >     
> >     public void endXXX(WebResponse)
> >     {
> >         // Assert result
> >         [...]
> >     }
> >     
> >     [...]
> > }        
> > 
> > 	 
> > 
> > 
> 
> > ATTACHMENT part 2 application/ms-tnef name=winmail.dat
> > --
> > To unsubscribe, e-mail:  
> <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:cactus-user-help@jakarta.apache.org>
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:cactus-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message