Package org.objectweb.celtix.buslifecycle

Examples of org.objectweb.celtix.buslifecycle.BusLifeCycleListener


    RMSource(RMHandler h) {
        super(h);
        map = new HashMap<String, SourceSequence>();
        Bus bus = h.getBus();
        bus.getLifeCycleManager().registerLifeCycleListener(new BusLifeCycleListener() {
            public void initComplete() {     
            }
            public void postShutdown() {     
            }
            public void preShutdown() {
View Full Code Here


public class CeltixBusLifeCycleManagerTest extends TestCase {

    public void testListenerNotRegistered() {

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

        EasyMock.reset(listener1);
        EasyMock.replay(listener1);
        mgr.initComplete();
View Full Code Here

        EasyMock.verify(listener1);
    }
   
    public void testSingleListenerRegistration() {

        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CeltixBusLifeCycleManager mgr = new CeltixBusLifeCycleManager();
       
        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

        EasyMock.verify(listener1);       
    }
   
    public void testDuplicateRegistration() {
       
        BusLifeCycleListener listener1 = EasyMock.createMock(BusLifeCycleListener.class);
        CeltixBusLifeCycleManager mgr = new CeltixBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener1);
        mgr.registerLifeCycleListener(listener1);

        EasyMock.reset(listener1);
        listener1.initComplete();
        EasyMock.expectLastCall().times(2);
        EasyMock.replay(listener1);
        mgr.initComplete();
        EasyMock.verify(listener1);

        EasyMock.reset(listener1);
        listener1.preShutdown();
        EasyMock.expectLastCall().times(2);
        EasyMock.replay(listener1);
        mgr.preShutdown();
        EasyMock.verify(listener1);

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

   
    public void testMultipleListeners() {
      
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CeltixBusLifeCycleManager mgr = new CeltixBusLifeCycleManager();

        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

   
    public void testDeregistration() {
       
        IMocksControl ctrl = EasyMock.createStrictControl();
       
        BusLifeCycleListener listener1 = ctrl.createMock(BusLifeCycleListener.class);
        BusLifeCycleListener listener2 = ctrl.createMock(BusLifeCycleListener.class);
        CeltixBusLifeCycleManager mgr = new CeltixBusLifeCycleManager();

        mgr.registerLifeCycleListener(listener2);
        mgr.registerLifeCycleListener(listener1);
        mgr.unregisterLifeCycleListener(listener2);
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.buslifecycle.BusLifeCycleListener

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.