mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
@Test
    public void testHandleControllerRemovedEvent()
    {
        // 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);
        
        //assert that there are items in the map
        assertThat(m_SUT.getTransportsAsync(systemId1).size(), is(greaterThan(0)));
        assertThat(m_SUT.getLinksAsync(systemId1).size(), is(greaterThan(0)));
        assertThat(m_SUT.getPhysicalsAsync(systemId1).size(), is(greaterThan(0)));
   
        Event removedController = mockControllerRemovedEvent(systemId1);
        m_ControllerEventListener.handleEvent(removedController);
        
        //verify that all objects have been removed from each map.
        assertThat(m_SUT.getTransportsAsync(systemId1).size(), is(0));
        assertThat(m_SUT.getLinksAsync(systemId1).size(), is(0));
        assertThat(m_SUT.getPhysicalsAsync(systemId1).size(), is(0));
    }
/**
     * Test proper handling of a controller removed event.
     * Verify that the comms stack objects for the removed controller no longer exists.
     */
Test proper handling of a controller removed event.
Verify that the comms stack objects for the removed controller no longer exists.
Test proper handling of a controller removed event . Verify that the comms stack objects for the removed controller no longer exists .
@Test
    public void testHandleControllerRemovedEvent()
    {
        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);
        assertThat(m_SUT.getTransportsAsync(systemId1).size(), is(greaterThan(0)));
        assertThat(m_SUT.getLinksAsync(systemId1).size(), is(greaterThan(0)));
        assertThat(m_SUT.getPhysicalsAsync(systemId1).size(), is(greaterThan(0)));
        Event removedController = mockControllerRemovedEvent(systemId1);
        m_ControllerEventListener.handleEvent(removedController);
        assertThat(m_SUT.getTransportsAsync(systemId1).size(), is(0));
        assertThat(m_SUT.getLinksAsync(systemId1).size(), is(0));
        assertThat(m_SUT.getPhysicalsAsync(systemId1).size(), is(0));
    }
@ Test public void testHandleControllerRemovedEvent ( ) { 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 ) ; assertThat ( m_SUT . getTransportsAsync ( systemId1 ) . size ( ) , is ( greaterThan ( 0 ) ) ) ; assertThat ( m_SUT . getLinksAsync ( systemId1 ) . size ( ) , is ( greaterThan ( 0 ) ) ) ; assertThat ( m_SUT . getPhysicalsAsync ( systemId1 ) . size ( ) , is ( greaterThan ( 0 ) ) ) ; Event removedController = mockControllerRemovedEvent ( systemId1 ) ; m_ControllerEventListener . handleEvent ( removedController ) ; assertThat ( m_SUT . getTransportsAsync ( systemId1 ) . size ( ) , is ( 0 ) ) ; assertThat ( m_SUT . getLinksAsync ( systemId1 ) . size ( ) , is ( 0 ) ) ; assertThat ( m_SUT . getPhysicalsAsync ( systemId1 ) . size ( ) , is ( 0 ) ) ; }
Test proper handling of a controller removed event.
Test proper handling of a controller removed event .
// Mini test setup //assert that there are items in the map //verify that all objects have been removed from each map.