jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Coyner <guitarman_...@yahoo.com>
Subject Re: JSP testing, anybody?
Date Tue, 21 Jan 2003 15:39:09 GMT
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

Mime
View raw message