mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleControllerRemovedEvent()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);

        //replay
        getAssetsReponse = mockGetAssetsResponse(systemId2);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);

        //verify assets added, remember this will return all assets known
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        assertThat(m_SUT.getAssetsForControllerAsync(systemId2).size(), is(2));
        
        //get controller removed event
        Event removedController = mockControllerRemovedEvent(systemId1);
        m_ControllerEvent.handleEvent(removedController);
        
        //verify that the system id is no longer known
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).isEmpty(), is(true));
    }
/**
     * Test the handling of controller removed event.
     * Verify that the correct system id is removed.
     */
Test the handling of controller removed event.
Verify that the correct system id is removed.
Test the handling of controller removed event . Verify that the correct system id is removed .
@Test
    public void testHandleControllerRemovedEvent()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        getAssetsReponse = mockGetAssetsResponse(systemId2);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        assertThat(m_SUT.getAssetsForControllerAsync(systemId2).size(), is(2));
        Event removedController = mockControllerRemovedEvent(systemId1);
        m_ControllerEvent.handleEvent(removedController);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).isEmpty(), is(true));
    }
@ Test public void testHandleControllerRemovedEvent ( ) { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; getAssetsReponse = mockGetAssetsResponse ( systemId2 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId2 ) . size ( ) , is ( 2 ) ) ; Event removedController = mockControllerRemovedEvent ( systemId1 ) ; m_ControllerEvent . handleEvent ( removedController ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . isEmpty ( ) , is ( true ) ) ; }
Test the handling of controller removed event.
Test the handling of controller removed event .
//this should render two assets for the system id //replay //this should render two assets for the system id //verify assets added, remember this will return all assets known //get controller removed event //verify that the system id is no longer known