Search in sources :

Example 6 with ROstringSeq

use of alma.ACS.ROstringSeq in project ACS by ACS-Community.

the class SpecialTestMasterComponentTest method testHealthySubsystemLifecycle.

/**
	 * Sends the normally expected events <code>SUBSYSEVENT_INITPASS1</code>,
	 * <code>SUBSYSEVENT_INITPASS2</code>, <code>SUBSYSEVENT_START</code>,  
	 * <code>SUBSYSEVENT_STOP</code>, <code>SUBSYSEVENT_SHUTDOWNPASS1</code>,
	 * <code>SUBSYSEVENT_SHUTDOWNPASS2</code>
	 * to our test master component.
	 * Uses state change notification to synchronize sending the next event.
	 * 
	 * @throws Exception
	 */
public void testHealthySubsystemLifecycle() throws Exception {
    ROstringSeq statesProperty = m_masterComp.currentStateHierarchy();
    assertNotNull(statesProperty);
    StateChangeListener listener = new StateChangeListener(m_logger);
    listener.createMonitor(statesProperty, getContainerServices());
    StateChangeSemaphore sync = listener.getStateChangeSemaphore();
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_INITPASS1);
    sync.waitForStateChanges(2);
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_INITPASS2);
    sync.waitForStateChanges(2);
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_START);
    sync.waitForStateChanges(1);
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_STOP);
    sync.waitForStateChanges(1);
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_SHUTDOWNPASS1);
    sync.waitForStateChanges(2);
    sync.reset();
    m_masterComp.doTransition(SubsystemStateEvent.SUBSYSEVENT_SHUTDOWNPASS2);
    sync.waitForStateChanges(2);
    listener.destroyMonitor();
}
Also used : ROstringSeq(alma.ACS.ROstringSeq) StateChangeSemaphore(alma.ACS.MasterComponentImpl.StateChangeSemaphore) StateChangeListener(alma.ACS.MasterComponentImpl.StateChangeListener)

Aggregations

ROstringSeq (alma.ACS.ROstringSeq)6 StateChangeListener (alma.ACS.MasterComponentImpl.StateChangeListener)2 CBDescIn (alma.ACS.CBDescIn)1 StateChangeSemaphore (alma.ACS.MasterComponentImpl.StateChangeSemaphore)1 MonitorstringSeq (alma.ACS.MonitorstringSeq)1 CompletionHolder (alma.ACSErr.CompletionHolder)1 IllegalStateEventEx (alma.ACSErrTypeCommon.IllegalStateEventEx)1 NoPermissionEx (alma.maciErrType.NoPermissionEx)1 POAManager (org.omg.PortableServer.POAManager)1 ClientInfo (si.ijs.maci.ClientInfo)1 Manager (si.ijs.maci.Manager)1 SimpleMasterComponent (test.jbaci.SimpleMasterComponent)1