jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: Cactus: multiple beginXXX(WebRequest) methods a YYYTestCase derivation
Date Sat, 13 Dec 2003 22:39:24 GMT
Hi Tom,

> -----Original Message-----
> From: Tom Pittard [mailto:tspittard@earthlink.net]
> Sent: 12 December 2003 10:13
> To: Vincent Massol
> Subject: Cactus: multiple beginXXX(WebRequest) methods a YYYTestCase
> derivation
> Hi Vincent,
> I noticed that it is possible to have at least two beginXXX methods in
> class derived from ServletTestCase and have them both automatically
> by the Cactus framework.  The TestAdminServlet example code from JUnit
> Action is such a class.  It contains both
> "public void beginGetCommandOk(WebRequest request)"
> and
> "public void beginDoGet(WebRequest request)".
> The YYYTestCase.runTest() method calls both of these from a client
> instance when the tests are run.  To see how far this could go I
placed a
> couple more beginXXX stubs in the class:
> public void beginDummy01(WebRequest request)
> public void beginDummy02(WebRequest request)
> however, these were not called.
> How did Cactus know to call the first two beginXXX methods you put in
> TestAdminServlet class but not the stubs I hacked in?

A cactus test (XXX) is made of:

A beginXXX method (optional)
A testXXX method (mandatory, as in JUnit)
An endXXX method (optional)

Cactus only calls beginXXX and endXXX if it can find a test, i.e. a
testXXX method.


PS: I'm sending the answer to the cactus mailing list as this is the
place to ask any question about Cactus. If you have specific questions
about JUnit in Action code, you can also use the junitbook mailing list
on http://junitbook.sf.net (this site is used to discuss the book's code
which has been open-sourced). For question about the book itself, please
use the Manning forum on http://manning.com/massol/. Yeah, I know, there
are lots of places... ;-)


View raw message