Package org.apache.cxf.bus.extension

Examples of org.apache.cxf.bus.extension.ExtensionManagerBus


       
    }
   
    @Test
    public void testShutdownWithBusLifecycle() {
        final CXFBusImpl bus = new ExtensionManagerBus();
        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
        BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
        EasyMock.reset(listener);
        listener.preShutdown();
        EasyMock.expectLastCall();
        listener.postShutdown();
        EasyMock.expectLastCall();       
        EasyMock.replay(listener);       
        lifeCycleManager.registerLifeCycleListener(listener);
        bus.shutdown(true);
        EasyMock.verify(listener);
       
    }
View Full Code Here


    }

    @Override
    protected Bus createBus() throws BusException {
        ExtensionManagerBus bus = new ExtensionManagerBus();
        BusFactory.setDefaultBus(bus);
        return bus;
    }
View Full Code Here

     * The very first bus created is set as a default bus which then can
     * be (re)used in other places.
     */
    public static Bus getBus() {       
        getDefaultBus();
        return new ExtensionManagerBus();
    }
View Full Code Here

    }

    @Override
    protected Bus createBus() throws BusException {
        ExtensionManagerBus bus = new ExtensionManagerBus();
        BusFactory.setDefaultBus(bus);
        return bus;
    }
View Full Code Here

        ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(new TestClassLoader());
            BusFactory factory = new CXFBusFactory() {
                public Bus createBus(Map<Class<?>, Object> e, Map<String, Object> properties) {
                    return new ExtensionManagerBus(e, properties, this.getClass().getClassLoader());
                }
            };
            Bus bus = factory.createBus();
            assertNotNullExtensions(bus);
            bus.shutdown(true);
View Full Code Here

*/
public class EndpointImplTest extends Assert {
   
    @Test
    public void testEqualsAndHashCode() throws Exception {
        Bus bus = new ExtensionManagerBus();
        Service svc = new ServiceImpl();
        EndpointInfo ei = new EndpointInfo();
        ei.setAddress("http://nowhere.com/bar/foo");
        EndpointInfo ei2 = new EndpointInfo();
        ei2.setAddress("http://nowhere.com/foo/bar");
View Full Code Here

        bus.shutdown(true);
    }
    @Test
    public void testConstructionWithoutExtensions() throws BusException {
       
        Bus bus = new ExtensionManagerBus();
        assertNotNull(bus.getExtension(BindingFactoryManager.class));
        assertNotNull(bus.getExtension(ConduitInitiatorManager.class));  
        assertNotNull(bus.getExtension(DestinationFactoryManager.class));
        assertNotNull(bus.getExtension(PhaseManager.class));
        bus.shutdown(true);
    }
View Full Code Here

       
        extensions.put(BindingFactoryManager.class, bindingFactoryManager);
        extensions.put(InstrumentationManager.class, instrumentationManager);
        extensions.put(PhaseManager.class, phaseManager);
       
        Bus bus = new ExtensionManagerBus(extensions);
       
        assertSame(bindingFactoryManager, bus.getExtension(BindingFactoryManager.class));
        assertSame(instrumentationManager, bus.getExtension(InstrumentationManager.class));
        assertSame(phaseManager, bus.getExtension(PhaseManager.class));
 
    }
View Full Code Here

 
    }

    @Test
    public void testExtensions() {
        Bus bus = new ExtensionManagerBus();
        String extension = "CXF";
        bus.setExtension(extension, String.class);
        assertSame(extension, bus.getExtension(String.class));
        bus.shutdown(true);
    }
View Full Code Here

        bus.shutdown(true);
    }
   
    @Test
    public void testBusID() {
        Bus bus = new ExtensionManagerBus();
        String id = bus.getId();
        assertEquals("The bus id should be cxf", id, Bus.DEFAULT_BUS_ID + Math.abs(bus.hashCode()));
        bus.setId("test");
        assertEquals("The bus id should be changed", "test", bus.getId());
        bus.shutdown(true);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.bus.extension.ExtensionManagerBus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.