mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/TestBundleMgrImpl.java
@Test
    public void testHandleSendEventStop() throws SecurityException, IllegalArgumentException, NoSuchFieldException, 
        IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        
        setupBundleEvent("STOPPED_REMOTE");
        
        addBundleToMap(Bundle.ACTIVE);
        
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Active"));
        
        m_RemoteBundleHelper.handleEvent(m_Event);
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        
        Event event = eventCaptor.getValue();
        assertThat(event.getTopic(), is(BundleMgr.TOPIC_BUNDLE_STATUS_UPDATED));
        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"));
        
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Resolved"));
    }
/**
     * Test the bundle event handler handling a stop bundle event.
     * Verify that the bundle's state is changed to resolved.
     */
Test the bundle event handler handling a stop bundle event.
Verify that the bundle's state is changed to resolved.
Test the bundle event handler handling a stop bundle event . Verify that the bundle ' s state is changed to resolved .
@Test
    public void testHandleSendEventStop() throws SecurityException, IllegalArgumentException, NoSuchFieldException, 
        IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        setupBundleEvent("STOPPED_REMOTE");
        addBundleToMap(Bundle.ACTIVE);
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Active"));
        m_RemoteBundleHelper.handleEvent(m_Event);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat(event.getTopic(), is(BundleMgr.TOPIC_BUNDLE_STATUS_UPDATED));
        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"));
        assertThat(m_SUT.getBundlesAsync(25).get(0).getState(), is("Resolved"));
    }
@ Test public void testHandleSendEventStop ( ) throws SecurityException , IllegalArgumentException , NoSuchFieldException , IllegalAccessException { m_SUT . getBundlesAsync ( 25 ) ; setupBundleEvent ( "STOPPED_REMOTE" ) ; addBundleToMap ( Bundle . ACTIVE ) ; assertThat ( m_SUT . getBundlesAsync ( 25 ) . get ( 0 ) . getState ( ) , is ( "Active" ) ) ; m_RemoteBundleHelper . handleEvent ( m_Event ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( event . getTopic ( ) , is ( BundleMgr . TOPIC_BUNDLE_STATUS_UPDATED ) ) ; 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" ) ) ; assertThat ( m_SUT . getBundlesAsync ( 25 ) . get ( 0 ) . getState ( ) , is ( "Resolved" ) ) ; }
Test the bundle event handler handling a stop bundle event.
Test the bundle event handler handling a stop bundle event .