jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brette, Marc" <Marc.Bre...@mkms.xerox.com>
Subject Parameters in the request that depends on the servlet to test
Date Fri, 13 Sep 2002 13:04:51 GMT
I have a servlet to test that need severals parameters in the request :
- an action, that specify the action to perform
- an objectId, that specify on wich object the action is to be performed

I need to perform a test where I must call the servlet to create an
objectId, then call this servlet with the request containing this queryId as
a parameter.

Something like :

public void testXXX() {
	MyServlet myServ = new MyServlet() ;
	String objectId = myServ.createNewObject() ;
	request.setParameter("action", "someAction") ;
	request.setParameter("objectId", objectId) ;
	myServ.dispatch(request, response) ;

Unfortunately, Cactus request does not allow modifying parameters. So the
above code don't work

(Another possibility would be to first perform a test and get the objectId
in endXXX(), then perform a second test passing the queryId in beginXXX, but
I understood this is not in Cactus spirit)

Do you have any idea (or is it not considered a unit test :-)) ?


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

View raw message