Package org.apache.cxf.bus.managers

Examples of org.apache.cxf.bus.managers.CXFBusLifeCycleManager


    @Test
    public void testListenerNotRegistered() {

        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.initComplete();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.preShutdown();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.postShutdown();
        EasyMock.verify(listener1);
    }
View Full Code Here


   
    @Test
    public void testSingleListenerRegistration() {

        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();
       
        mgr.registerLifeCycleListener(listener1);

        EasyMock.reset(listener1);
        listener1.initComplete();
        EasyMock.replay(listener1);
        mgr.initComplete();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        listener1.preShutdown();
        EasyMock.replay(listener1);
        mgr.preShutdown();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        listener1.postShutdown();
        EasyMock.replay(listener1);
        mgr.postShutdown();
        EasyMock.verify(listener1);       
    }
View Full Code Here

      
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener1);
        mgr.registerLifeCycleListener(listener2);
       
        ctrl.reset();
        listener1.initComplete();
        listener2.initComplete();
        ctrl.replay();
        mgr.initComplete();
        ctrl.verify();
       
        ctrl.reset();
        listener2.preShutdown();
        listener1.preShutdown();
        ctrl.replay();
        mgr.preShutdown();
        ctrl.verify();
       
        ctrl.reset();
        listener2.postShutdown();
        listener1.postShutdown();
        ctrl.replay();
        mgr.postShutdown();
        ctrl.verify();
    }
View Full Code Here

       
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener2);
        mgr.registerLifeCycleListener(listener1);
        mgr.unregisterLifeCycleListener(listener2);
       
        ctrl.reset();
        listener1.initComplete();
        ctrl.replay();
        mgr.initComplete();
        ctrl.verify();
       
        ctrl.reset();
        listener1.preShutdown();
        ctrl.replay();
        mgr.preShutdown();
        ctrl.verify();
       
        ctrl.reset();
        listener1.postShutdown();
        ctrl.replay();
        mgr.postShutdown();
        ctrl.verify();
    }
View Full Code Here

    public void testParentApplicationEvent() {
        AbstractRefreshableApplicationContext parent = new ClassPathXmlApplicationContext();
        parent.refresh();
        SpringBusFactory factory = new SpringBusFactory(parent);
        Bus bus = factory.createBus();
        CXFBusLifeCycleManager manager = bus.getExtension(CXFBusLifeCycleManager.class);
        BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
        manager.registerLifeCycleListener(listener);
        EasyMock.reset(listener);
        listener.preShutdown();
        EasyMock.expectLastCall().times(1);
        listener.postShutdown();
        EasyMock.expectLastCall().times(1);
View Full Code Here

    @Test
    public void testListenerNotRegistered() {

        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.initComplete();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.preShutdown();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.postShutdown();
        EasyMock.verify(listener1);
    }
View Full Code Here

   
    @Test
    public void testSingleListenerRegistration() {

        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();
       
        mgr.registerLifeCycleListener(listener1);

        EasyMock.reset(listener1);
        listener1.initComplete();
        EasyMock.replay(listener1);
        mgr.initComplete();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        listener1.preShutdown();
        EasyMock.replay(listener1);
        mgr.preShutdown();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        listener1.postShutdown();
        EasyMock.replay(listener1);
        mgr.postShutdown();
        EasyMock.verify(listener1);       
    }
View Full Code Here

      
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener1);
        mgr.registerLifeCycleListener(listener2);
       
        ctrl.reset();
        listener1.initComplete();
        listener2.initComplete();
        ctrl.replay();
        mgr.initComplete();
        ctrl.verify();
       
        ctrl.reset();
        listener1.preShutdown();
        listener2.preShutdown();
        ctrl.replay();
        mgr.preShutdown();
        ctrl.verify();
       
        ctrl.reset();
        listener1.postShutdown();
        listener2.postShutdown();
        ctrl.replay();
        mgr.postShutdown();
        ctrl.verify();
    }
View Full Code Here

       
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CXFBusLifeCycleManager mgr = new CXFBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener2);
        mgr.registerLifeCycleListener(listener1);
        mgr.unregisterLifeCycleListener(listener2);
       
        ctrl.reset();
        listener1.initComplete();
        ctrl.replay();
        mgr.initComplete();
        ctrl.verify();
       
        ctrl.reset();
        listener1.preShutdown();
        ctrl.replay();
        mgr.preShutdown();
        ctrl.verify();
       
        ctrl.reset();
        listener1.postShutdown();
        ctrl.replay();
        mgr.postShutdown();
        ctrl.verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.bus.managers.CXFBusLifeCycleManager

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.