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: JSPTestCase
Date Tue, 16 Apr 2002 07:40:20 GMT
Arathi,

What do you call JSP testing ?

Here is what Cactus can do :

* Unit test your taglibs. You do this by using JspTestCase which
provides all the JSP API objects to your test case (testXXX() method).

* Functional unit testing, i.e. assert the result of the JSP after it is
executed. This is not the core of Cactus but Cactus does provide this
feature mostly through its tight integration with HttpUnit. Here is how
you would do that :

public class YYY extends ServletTestCase
{
  public void testXXX()
  {
    RequestDispatcher rd =
config.getServletContext().getRequestDispatcher("jsptotest.jsp");
    rd.forward(request, response);
  }

  // Solution 1
  public void endXXX(WebResponse response)
  {
     // perform asserts
  }

  // Solution 2 (recommended for better parsing API)
  public void endXXX(com.meterware.httpunit.WebResponse response)
  {
     // perform asserts
  }
}

Hope it helps
-Vincent

> -----Original Message-----
> From: Arathi.Bhaskar@itsindia.com [mailto:Arathi.Bhaskar@itsindia.com]
> Sent: 15 April 2002 07:36
> To: cactus-user@jakarta.apache.org
> Subject: JSPTestCase
> 
> Hi
> 
> I have started using Cactus for my Servlets Testing. Can I use the
> JSPTestCase for actual JSP Testing.
> 
> Is there any unit testing tool other than Cactus for JSP Testing.
> 
> Thanks & Regards
> Arathi
> 
> -----------------------Disclaimer------------------------
> 
> The views of the author may not necessarily reflect those
> of the Company. All liability is excluded to the extent
> permitted by law for any claims arising as a result of the
> use of this medium to transmit information by or to
> IT Solutions (India) Pvt. Ltd.
> 
> We have taken precautions to minimize the risk of
> transmitting software viruses, but we advise you to
> carry out your own virus checks on any attachment to
> this message.  We cannot accept liability for any loss or
> damage caused by software viruses.
> 
> ------------------------Disclaimer------------------------
> 
> 
> --
> 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