package org.codehaus.xfire.plexus.config;

import org.apache.log4j.BasicConfigurator;
import org.codehaus.xfire.plexus.PlexusXFireTest;
import org.codehaus.xfire.service.object.ObjectService;
import org.dom4j.Document;

/**
 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
 * @since Sep 20, 2004
 */
public class ConfigurationTest 
    extends PlexusXFireTest
{
    public void setUp()
        throws Exception
    {
        System.setProperty("xfire.config", "/org/codehaus/xfire/plexus/config/services.xml");
        super.setUp();
        BasicConfigurator.configure();
        lookup(ConfigurationService.ROLE);
    }
    
    public void testRegister()
        throws Exception
    {
        ObjectService service = (ObjectService) getServiceRegistry().getService("Echo");
        
        assertNotNull(service); 
        
        service = (ObjectService) getServiceRegistry().getService("EchoXMLBeans");
        assertNotNull( service ); 
        
        service = (ObjectService) getServiceRegistry().getService("EchoWSDL");
        assertNotNull( service ); 
        assertEquals(1, service.getOperations().size());
    }
    
    public void testInvoke() 
    	throws Exception
    {
        Document response = invokeService("Echo", "/org/codehaus/xfire/plexus/config/echo11.xml");
        
        addNamespace("e", "urn:Echo");
        assertValid("//e:out[text()='Yo Yo']", response);
        
        response = invokeService("EchoIntf", "/org/codehaus/xfire/plexus/config/echo11.xml");
        
        addNamespace("e", "urn:Echo");
        assertValid("//e:out[text()='Yo Yo']", response);
    }
}

@@ -40,51 +40,8 @@
 g;%0A%0A
-import org.apache.log4j.BasicConfigurator;%0A
 impo
@@ -508,46 +508,8 @@
 ();%0A
-        BasicConfigurator.configure();
 %0A   

Take out log4j reference.