host-tomcat fails to find servlet if it is added, removed and then added again.
-------------------------------------------------------------------------------

                 Key: TUSCANY-1913
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1913
             Project: Tuscany
          Issue Type: Bug
    Affects Versions: Java-SCA-1.0
            Reporter: Simon Laws
            Assignee: Simon Laws
             Fix For: Java-SCA-Next


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);
        {
            Socket client = new Socket("127.0.0.1", HTTP_PORT);
            OutputStream os = client.getOutputStream();
            os.write(REQUEST1.getBytes());
            os.flush();
            read(client);            
        }
        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);
        {
            Socket client = new Socket("127.0.0.1", HTTP_PORT);
            OutputStream os = client.getOutputStream();
            os.write(REQUEST1.getBytes());
            os.flush();
            read(client);            
        }
        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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to