Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java-SCA-1.0
-
None
-
None
Description
Extending the Tomcat unit test with the following
public void testRegisterUnregisterMapping() throws Exception {
TomcatServer service = new TomcatServer(workScheduler);
TestServlet servlet = new TestServlet();
service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
assertTrue(servlet.invoked);
service.removeServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo");
{ Socket client = new Socket("127.0.0.1", HTTP_PORT); OutputStream os = client.getOutputStream(); os.write(REQUEST1.getBytes()); os.flush(); read(client); }
servlet = new TestServlet();
service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);
assertTrue(servlet.invoked);
service.stop();
}
Leads to
INFO: Added Servlet mapping: http://L3AW203:8085/foo
19-Nov-2007 14:37:20 org.apache.tuscany.sca.http.tomcat.TomcatServer removeServletMapping
INFO: Remove Servlet mapping: /foo
19-Nov-2007 14:37:31 org.apache.catalina.core.StandardWrapperValve invoke
INFO: Servlet /foo is currently unavailable
19-Nov-2007 14:37:40 org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
INFO: Added Servlet mapping: http://L3AW203:8085/foo
19-Nov-2007 14:37:49 org.apache.catalina.core.StandardWrapperValve invoke
INFO: Servlet /foo is currently unavailable