jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Childers" <jchild...@hotels.com>
Subject Clearing request parameters in test method
Date Tue, 10 Dec 2002 21:01:28 GMT
All,

Reposting this question because I haven't found an answer yet.

I am looking to test a tag which sets a session attribute based on a request parameter. I
need to be able to test multiple requests in the same test, something like the following:

public void beginTestTwice(WebRequest wRequest) {
	wRequest.addParameter("lang", "es");
}

public void testTwiceWithSpanish() throws Exception {
	htmlTag.doStartTag();
	assertEquals("es", request.getSession().getAttribute("lang"));

	// Need to clear request parameter here, otherwise following assertion fails
	assertNull(request.getParameter("lang"));
	htmlTag.doStartTag();
	assertEquals("es", request.getSession().getAttribute("lang"));
}

The problem is that I cannot find a way to clear the request parameter either in the test
method or the end method.

Thanks in advance,

-= James

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


Mime
View raw message