methods.
| Method from org.apache.cactus.sample.servlet.unit.TestGlobalBeginEnd Detail: |
public void begin(WebRequest theRequest) {
theRequest.addParameter("param1", "value1");
}
Verify that it is possible to modify the WebRequest in
the common begin() method. It also verifies that
begin() is called at all. |
public void beginGlobalBeginEnd(WebRequest theRequest) {
assertEquals("value1", theRequest.getParameterGet("param1"));
}
Verify that it is possible to modify the WebRequest in
the common begin()() method. It also verifies that
begin() is called at all. |
public void end(WebResponse theResponse) {
assertEquals("Hello there!", theResponse.getText());
this.isClientGlobalEndCalled = true;
}
Verify that it is possible to read the connection object once in
endXXX() and then again in end(). It also
verifies that end() is called at all. |
public void endGlobalBeginEnd(WebResponse theResponse) {
assertEquals("Hello there!", theResponse.getText());
}
Verify that it is possible to read the connection object once in
endXXX() and then again in end(). It also
verifies that end() is called at all. |
protected void runTest() throws Throwable {
super.runTest();
// Make sure we verify if end() has been called only on
// the client side. Reason is that the runTest() method is
// called both on the client side and on the server side.
if (this.request == null)
{
if (!this.isClientGlobalEndCalled)
{
fail("end() has not been called");
}
}
}
Verifies that end() has been called correctly. |
public void testGlobalBeginEnd() throws Exception {
assertEquals("value1", request.getParameter("param1"));
response.getWriter().print("Hello there!");
}
Verify that it is possible to modify the WebRequest in
the common begin()() method. It also verifies that
begin()() is called at all. |