jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brehm, Robert P" <robert.p.br...@office.xerox.com>
Subject RE: Writing Unit Tests in Cactus
Date Tue, 10 Aug 2004 18:34:32 GMT

Vincent,

Thanks for the clarification on the scope of Cactus and help suggestions.  I am still unsure
  how to do to following:

1) Create a JUnit client test to invoke a server side Cactus test redirector and to retrieve
the server side test results.
2) Create a Cactus server side test to retrieve server side test results and make them availble
to the client side JUnit test.

Regards,
Bob Brehm

-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com]
Sent: Tuesday, August 10, 2004 9:53 AM
To: 'Cactus Users List'
Subject: RE: Writing Unit Tests in Cactus


Hi Bob,

Cactus is a unit testing framework which means it will be useful to unit
test your code methods. Cactus will not be good to perform functional
testing. For functional testing, you should use one of the existing
framework (HttpUnit, HtmlUnit, etc). That means that you would write 2 tests
for the following use case: "A JSP page that emits HTML to the user. The
user then submits a form to another JSP page.".

The HttpUnit integration in Cactus is only useful to perform assertions on
the HTML/XML returned in a Servlet response. It cannot be used to send
forms, etc.

Please see http://jakarta.apache.org/cactus/writing/howto_jsp.html to see
how Cactus can help to unit test JSP pages.

For HttpUnit integration, please see
http://jakarta.apache.org/cactus/writing/howto_httpunit.html

Please also check 
http://jakarta.apache.org/cactus/faq.html#faq_chaining_requests

Thanks
-Vincent

> -----Original Message-----
> From: Brehm, Robert P [mailto:robert.p.brehm@office.xerox.com]
> Sent: mardi 10 août 2004 18:46
> To: 'cactus-user@jakarta.apache.org'
> Subject: Writing Unit Tests in Cactus
> 
> 
> Hello,
> 
> I am new to Cactus, and I am therefore on the learning curve.  I am trying
> to test the following:
> 
> 1) A JSP page that emits HTML to the user.  The user then submits a form
> to another JSP page.
> 2) This JSP page that acts as a front controller.  It process the form and
> then does queries via a business delegate.
> 3) If the front controller is successful in (2) then it completes the
> transaction then forwards to another JSP page.
> 4) This new JSP page emits HTML to the user who then submits a form to
> another front controller and so on.
> 
> I have the HttpUnit working to get the HTML and submit the form.   I am
> having great difficulty in trying to determine the steps required to:
> 
> 1) Intercept parameters that the user submits in a form and,
> 2) Call a Cactus test from my client side JUnit program.
> 
> Any help would be appreciated.
> 
> Regards,
> 
> Bob Brehm
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org



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

Mime
View raw message