mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/TestBundleMgrImpl.java
@Test
    public void testHandleBundleEventUninstall() throws SecurityException, IllegalArgumentException, 
        NoSuchFieldException, IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        
        setupBundleEvent("UNINSTALLED_REMOTE");
        
        addBundleToMap(Bundle.ACTIVE);
        
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Active"));
        
        m_RemoteBundleHelper.handleEvent(m_Event);

        assertThat(m_SUT.getBundlesAsync(25).isEmpty(), is(true));
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        
        Event event = eventCaptor.getValue();
        
        assertThat(event.getTopic(), is(BundleMgr.TOPIC_BUNDLE_INFO_REMOVED));
        assertThat(event.getProperty(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is((Object)25));
        assertThat(event.getProperty(EventConstants.BUNDLE_ID), is((Object)5L));
        assertThat(event.getProperty(BundleMgr.EVENT_PROP_BUNDLE_LOCATION), is((Object)"Location"));
    }
/**
     * Test the bundle event handler handling an uninstall bundle event.
     * Verify that the bundle has been removed from the controller's list of installed bundles.
     */
Test the bundle event handler handling an uninstall bundle event.
Verify that the bundle has been removed from the controller's list of installed bundles.
Test the bundle event handler handling an uninstall bundle event . Verify that the bundle has been removed from the controller ' s list of installed bundles .
@Test
    public void testHandleBundleEventUninstall() throws SecurityException, IllegalArgumentException, 
        NoSuchFieldException, IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        setupBundleEvent("UNINSTALLED_REMOTE");
        addBundleToMap(Bundle.ACTIVE);
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Active"));
        m_RemoteBundleHelper.handleEvent(m_Event);
        assertThat(m_SUT.getBundlesAsync(25).isEmpty(), is(true));
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat(event.getTopic(), is(BundleMgr.TOPIC_BUNDLE_INFO_REMOVED));
        assertThat(event.getProperty(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID), is((Object)25));
        assertThat(event.getProperty(EventConstants.BUNDLE_ID), is((Object)5L));
        assertThat(event.getProperty(BundleMgr.EVENT_PROP_BUNDLE_LOCATION), is((Object)"Location"));
    }
@ Test public void testHandleBundleEventUninstall ( ) throws SecurityException , IllegalArgumentException , NoSuchFieldException , IllegalAccessException { m_SUT . getBundlesAsync ( 25 ) ; setupBundleEvent ( "UNINSTALLED_REMOTE" ) ; addBundleToMap ( Bundle . ACTIVE ) ; assertThat ( m_SUT . getBundlesAsync ( 25 ) . get ( 0 ) . getState ( ) , is ( "Active" ) ) ; m_RemoteBundleHelper . handleEvent ( m_Event ) ; assertThat ( m_SUT . getBundlesAsync ( 25 ) . isEmpty ( ) , is ( true ) ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( event . getTopic ( ) , is ( BundleMgr . TOPIC_BUNDLE_INFO_REMOVED ) ) ; assertThat ( event . getProperty ( SharedPropertyConstants . EVENT_PROP_CONTROLLER_ID ) , is ( ( Object ) 25 ) ) ; assertThat ( event . getProperty ( EventConstants . BUNDLE_ID ) , is ( ( Object ) 5L ) ) ; assertThat ( event . getProperty ( BundleMgr . EVENT_PROP_BUNDLE_LOCATION ) , is ( ( Object ) "Location" ) ) ; }
Test the bundle event handler handling an uninstall bundle event.
Test the bundle event handler handling an uninstall bundle event .