Hi Tom, > -----Original Message----- > From: Tom Pittard [mailto:[EMAIL PROTECTED] > 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 a > class derived from ServletTestCase and have them both automatically called > by the Cactus framework. The TestAdminServlet example code from JUnit in > 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 side > 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 the > 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. Thanks -Vincent 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... ;-) Thanks -Vincent --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
