You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by "Brette, Marc" <Ma...@mkms.xerox.com> on 2002/09/13 15:04:51 UTC

Parameters in the request that depends on the servlet to test

Hi,
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 :-)) ?

Thanks,
Marc

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>