package org.codehaus.xfire.transport.http;

import org.codehaus.xfire.addressing.AddressingInHandler;
import org.codehaus.xfire.addressing.AddressingOutHandler;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.ServiceRegistry;
import org.codehaus.xfire.test.AbstractServletTest;

import com.meterware.httpunit.HttpNotFoundException;

public class XFireConfigurableServletNewTest
    extends AbstractServletTest
{
    public void testServlet()
        throws Exception
    {
        try
        {
            newClient().getResponse("http://localhost/services/");
        }
        catch(HttpNotFoundException e) {}
        
        ServiceRegistry reg = getXFire().getServiceRegistry();

        assertTrue(reg.hasService("Echo"));
        Service echo = reg.getService("Echo");
        assertNotNull(echo.getName());
        assertNotSame("", echo.getName().getNamespaceURI());
        
        assertTrue(reg.hasService("Echo1"));
        Service echo1 = reg.getService("Echo1");
        assertNotNull(echo1.getBinding(SoapHttpTransport.SOAP12_HTTP_BINDING));

        assertEquals(2, echo1.getInHandlers().size());

        assertTrue(echo1.getInHandlers().get(1) instanceof AddressingInHandler);
        assertEquals(2, echo1.getOutHandlers().size());
        assertTrue(echo1.getOutHandlers().get(1) instanceof AddressingOutHandler);  
        
        assertEquals(2, getXFire().getInHandlers().size());
    }

    protected String getConfiguration()
    {
        return "/org/codehaus/xfire/transport/http/configurable-web.xml";
    }

}
@@ -1097,33 +1097,33 @@
    assertEquals(
-2
+3
 , echo1.getInHan
@@ -1135,25 +1135,24 @@
 ().size());%0A
-%0A
         asse
@@ -1176,33 +1176,33 @@
 nHandlers().get(
-1
+2
 ) instanceof Add
@@ -1360,16 +1360,17 @@
 dler);  
+ 
 %0A       

Fix test.We have new default handler, so handlers list size must updated.