mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
@Test
    public void testRemoteLinkActivated()
    {
        // Mini test setup
        m_SUT.getPhysicalsAsync(systemId1);
        m_SUT.getLinksAsync(systemId1);
        m_SUT.getTransportsAsync(systemId1);
        Event link = mockGetLayersResponse(systemId1, "link");
           
        m_EventHelperComms.handleEvent(link); 
        
        Event layerActivateEvent = mockIsActivatedResponse(systemId1, false); //set layer to be deactivated
        Event remoteLayerActivate = mockEventLinkActivated(systemId1, false);

        m_EventHelperLink.handleEvent(layerActivateEvent);
        m_EventHelper.handleEvent(remoteLayerActivate);

        List<CommsLayerLinkModelImpl> links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.get(0).isActivated(), is(true));
        
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        //verify push event for remote link update
        verify(m_EventAdmin, times(3)).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(CommsMgr.TOPIC_COMMS_LAYER_UPDATED));
    }
/**
     * Verify proper handling of remote link activated event.
     */
Verify proper handling of remote link activated event.
Verify proper handling of remote link activated event .
@Test
    public void testRemoteLinkActivated()
    {
        m_SUT.getPhysicalsAsync(systemId1);
        m_SUT.getLinksAsync(systemId1);
        m_SUT.getTransportsAsync(systemId1);
        Event link = mockGetLayersResponse(systemId1, "link");
        m_EventHelperComms.handleEvent(link); 
        Event layerActivateEvent = mockIsActivatedResponse(systemId1, false); 
        Event remoteLayerActivate = mockEventLinkActivated(systemId1, false);
        m_EventHelperLink.handleEvent(layerActivateEvent);
        m_EventHelper.handleEvent(remoteLayerActivate);
        List<CommsLayerLinkModelImpl> links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.get(0).isActivated(), is(true));
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(3)).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(CommsMgr.TOPIC_COMMS_LAYER_UPDATED));
    }
@ Test public void testRemoteLinkActivated ( ) { m_SUT . getPhysicalsAsync ( systemId1 ) ; m_SUT . getLinksAsync ( systemId1 ) ; m_SUT . getTransportsAsync ( systemId1 ) ; Event link = mockGetLayersResponse ( systemId1 , "link" ) ; m_EventHelperComms . handleEvent ( link ) ; Event layerActivateEvent = mockIsActivatedResponse ( systemId1 , false ) ; Event remoteLayerActivate = mockEventLinkActivated ( systemId1 , false ) ; m_EventHelperLink . handleEvent ( layerActivateEvent ) ; m_EventHelper . handleEvent ( remoteLayerActivate ) ; List < CommsLayerLinkModelImpl > links = m_SUT . getLinksAsync ( systemId1 ) ; assertThat ( links . get ( 0 ) . isActivated ( ) , is ( true ) ) ; ArgumentCaptor < Event > captor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , times ( 3 ) ) . postEvent ( captor . capture ( ) ) ; assertThat ( captor . getValue ( ) . getTopic ( ) , is ( CommsMgr . TOPIC_COMMS_LAYER_UPDATED ) ) ; }
Verify proper handling of remote link activated event.
Verify proper handling of remote link activated event .
// Mini test setup //set layer to be deactivated //verify push event for remote link update