mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleRemoteEventFactoryObjectDeleted()
    {
        //load assets for one system
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        
        //verify assets added
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        
        //mock event that a factory object was deleted for this system, should removed asset with uuid2
        Event objectDeleted = mockEventAssetDeleted(systemId1);
        
        m_EventHelper.handleEvent(objectDeleted);
        
        //verify asset removed
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(1));
        assertThat(models.get(0).getUuid(), is(uuid1));
        //verify user notification
        verify(m_GrowlUtil).createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "Asset removed.",
             String.format("An asset from controller 0x%08x was removed.", systemId1));
        
        //replay, send message again... nothing should happen
        m_EventHelper.handleEvent(objectDeleted);
        
        //verify asset removed
        models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(1));
        assertThat(models.get(0).getUuid(), is(uuid1));
    }
/**
     * Test the handling of remote object deleted event message.
     * Verify the appropriate asset is removed.
     */
Test the handling of remote object deleted event message.
Verify the appropriate asset is removed.
Test the handling of remote object deleted event message . Verify the appropriate asset is removed .
@Test
    public void testHandleRemoteEventFactoryObjectDeleted()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        Event objectDeleted = mockEventAssetDeleted(systemId1);
        m_EventHelper.handleEvent(objectDeleted);
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(1));
        assertThat(models.get(0).getUuid(), is(uuid1));
        verify(m_GrowlUtil).createGlobalFacesMessage(FacesMessage.SEVERITY_INFO, "Asset removed.",
             String.format("An asset from controller 0x%08x was removed.", systemId1));
        m_EventHelper.handleEvent(objectDeleted);
        models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(1));
        assertThat(models.get(0).getUuid(), is(uuid1));
    }
@ Test public void testHandleRemoteEventFactoryObjectDeleted ( ) { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; Event objectDeleted = mockEventAssetDeleted ( systemId1 ) ; m_EventHelper . handleEvent ( objectDeleted ) ; List < AssetModel > models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 1 ) ) ; assertThat ( models . get ( 0 ) . getUuid ( ) , is ( uuid1 ) ) ; verify ( m_GrowlUtil ) . createGlobalFacesMessage ( FacesMessage . SEVERITY_INFO , "Asset removed." , String . format ( "An asset from controller 0x%08x was removed." , systemId1 ) ) ; m_EventHelper . handleEvent ( objectDeleted ) ; models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 1 ) ) ; assertThat ( models . get ( 0 ) . getUuid ( ) , is ( uuid1 ) ) ; }
Test the handling of remote object deleted event message.
Test the handling of remote object deleted event message .
//load assets for one system //this should render two assets for the system id //verify assets added //mock event that a factory object was deleted for this system, should removed asset with uuid2 //verify asset removed //verify user notification //replay, send message again... nothing should happen //verify asset removed