mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
@Test
    public void testRemoteLayerDeleted()
    {
        // Mini test setup
        m_SUT.getPhysicalsAsync(systemId1);
        m_SUT.getLinksAsync(systemId1);
        m_SUT.getTransportsAsync(systemId1);
        Event transport = mockGetLayersResponse(systemId1, "transport");
        Event link = mockGetLayersResponse(systemId1, "link");
        Event physical = mockGetLayersResponse(systemId1, "physical");
        
        m_EventHelperComms.handleEvent(transport);    
        m_EventHelperComms.handleEvent(link);
        m_EventHelperComms.handleEvent(physical);
        
        List<CommsLayerBaseModel> transports = m_SUT.getTransportsAsync(systemId1);
        assertThat(transports.size(), is(1));  
        
        List<CommsLayerLinkModelImpl> links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.size(), is(2)); 
        
        List<CommsLayerBaseModel> physicals = m_SUT.getPhysicalsAsync(systemId1);
        assertThat(physicals.size(), is(3)); 
        
        Event remoteDeleteLayer = mockEventLayerDeleted(systemId1, "physical");
        m_EventHelper.handleEvent(remoteDeleteLayer);        
        physicals = m_SUT.getPhysicalsAsync(systemId1);
        assertThat(physicals.size(), is(2)); //size should be 1 smaller 
        
        remoteDeleteLayer = mockEventLayerDeleted(systemId1, "link");
        m_EventHelper.handleEvent(remoteDeleteLayer);
        links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.size(), is(1)); //size should be 1 smaller 
        
        remoteDeleteLayer = mockEventLayerDeleted(systemId1, "transport");
        m_EventHelper.handleEvent(remoteDeleteLayer);
        transports = m_SUT.getTransportsAsync(systemId1);
        assertThat(transports.size(), is(0)); 
    }
/**
     * Verify correct handling of layer deleted remotely
     */
Verify correct handling of layer deleted remotely
Verify correct handling of layer deleted remotely
@Test
    public void testRemoteLayerDeleted()
    {
        m_SUT.getPhysicalsAsync(systemId1);
        m_SUT.getLinksAsync(systemId1);
        m_SUT.getTransportsAsync(systemId1);
        Event transport = mockGetLayersResponse(systemId1, "transport");
        Event link = mockGetLayersResponse(systemId1, "link");
        Event physical = mockGetLayersResponse(systemId1, "physical");
        m_EventHelperComms.handleEvent(transport);    
        m_EventHelperComms.handleEvent(link);
        m_EventHelperComms.handleEvent(physical);
        List<CommsLayerBaseModel> transports = m_SUT.getTransportsAsync(systemId1);
        assertThat(transports.size(), is(1));  
        List<CommsLayerLinkModelImpl> links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.size(), is(2)); 
        List<CommsLayerBaseModel> physicals = m_SUT.getPhysicalsAsync(systemId1);
        assertThat(physicals.size(), is(3)); 
        Event remoteDeleteLayer = mockEventLayerDeleted(systemId1, "physical");
        m_EventHelper.handleEvent(remoteDeleteLayer);        
        physicals = m_SUT.getPhysicalsAsync(systemId1);
        assertThat(physicals.size(), is(2)); 
        remoteDeleteLayer = mockEventLayerDeleted(systemId1, "link");
        m_EventHelper.handleEvent(remoteDeleteLayer);
        links = m_SUT.getLinksAsync(systemId1);
        assertThat(links.size(), is(1)); 
        remoteDeleteLayer = mockEventLayerDeleted(systemId1, "transport");
        m_EventHelper.handleEvent(remoteDeleteLayer);
        transports = m_SUT.getTransportsAsync(systemId1);
        assertThat(transports.size(), is(0)); 
    }
@ Test public void testRemoteLayerDeleted ( ) { m_SUT . getPhysicalsAsync ( systemId1 ) ; m_SUT . getLinksAsync ( systemId1 ) ; m_SUT . getTransportsAsync ( systemId1 ) ; Event transport = mockGetLayersResponse ( systemId1 , "transport" ) ; Event link = mockGetLayersResponse ( systemId1 , "link" ) ; Event physical = mockGetLayersResponse ( systemId1 , "physical" ) ; m_EventHelperComms . handleEvent ( transport ) ; m_EventHelperComms . handleEvent ( link ) ; m_EventHelperComms . handleEvent ( physical ) ; List < CommsLayerBaseModel > transports = m_SUT . getTransportsAsync ( systemId1 ) ; assertThat ( transports . size ( ) , is ( 1 ) ) ; List < CommsLayerLinkModelImpl > links = m_SUT . getLinksAsync ( systemId1 ) ; assertThat ( links . size ( ) , is ( 2 ) ) ; List < CommsLayerBaseModel > physicals = m_SUT . getPhysicalsAsync ( systemId1 ) ; assertThat ( physicals . size ( ) , is ( 3 ) ) ; Event remoteDeleteLayer = mockEventLayerDeleted ( systemId1 , "physical" ) ; m_EventHelper . handleEvent ( remoteDeleteLayer ) ; physicals = m_SUT . getPhysicalsAsync ( systemId1 ) ; assertThat ( physicals . size ( ) , is ( 2 ) ) ; remoteDeleteLayer = mockEventLayerDeleted ( systemId1 , "link" ) ; m_EventHelper . handleEvent ( remoteDeleteLayer ) ; links = m_SUT . getLinksAsync ( systemId1 ) ; assertThat ( links . size ( ) , is ( 1 ) ) ; remoteDeleteLayer = mockEventLayerDeleted ( systemId1 , "transport" ) ; m_EventHelper . handleEvent ( remoteDeleteLayer ) ; transports = m_SUT . getTransportsAsync ( systemId1 ) ; assertThat ( transports . size ( ) , is ( 0 ) ) ; }
Verify correct handling of layer deleted remotely
Verify correct handling of layer deleted remotely
// Mini test setup //size should be 1 smaller  //size should be 1 smaller 