jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, Kevin" <KW...@TMRS.org>
Subject RE: Jsp Test Example?
Date Thu, 22 Aug 2002 15:52:18 GMT
Hi Kaarle and Vincent,

Thanks for the insights. The rationale for unit (vs functional) test jsps
for us is that jsps and servlets are developed in parallel by different
developers. I am reponsible for the jsps, including creating templates
(using Struts template taglibs) and binding data. It would be nice if I
could unit test jsps before the functional test, which require a fully
functional servlet component.

After reading the "JspTestCase Principles" carefully. I think there is a
easy way to "unit" test jsps under Cactus.

Thanks.
Kevin

-----Original Message-----
From: Vincent Massol [mailto:vmassol@octo.com]
Sent: Thursday, August 22, 2002 3:36 AM
To: 'Cactus Users List'
Subject: RE: Jsp Test Example?


Hi Kevin,

Kaarle is completely right, you would test that in the following ways :

- write a pure junit test for your java bean (as they have no
dependencies on the environment). You can also use Cactus if you wish to
have only one framework to set up.
- write cactus unit tests for taglibs (using JspTestCase)
- write cactus unit tests for your servlet controller and other classes
manipulating the servlet api (using ServletTestCase)
- write cactus functional tests for the returned HTML (using the
HttpUnit integration - see web site for details)

Thus Cactus offers you a full solution for unit testing your web
application ! :-)

Hey I will put this as a FAQ ...

Thanks
-Vincent

> -----Original Message-----
> From: Wang, Kevin [mailto:KWang@TMRS.org]
> Sent: 21 August 2002 21:00
> To: 'Cactus Users List'
> Subject: Jsp Test Example?
> 
> Does anyone have an example for testing Jsps? I looked over the
examples
> but
> could not find any.
> 
> The jsp is the view in our model. A servlet would populate the "bean"
> object
> and put in request and forward it to the jsp. The jsp would have the
> following:
> 
> <jsp:useBean id="bean" class="Bean" scope="request" />
> <%@ include file="../another.jsp" %>
> <%= bean.getName() %>
> ...
> 
> How would one test the jsp using Cactus in this case?
> 
> Thanks.
> Kevin
> 
> --
> 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