mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/TestBundleMgrImpl.java
@SuppressWarnings("unchecked")
    @Test
    public void testHandleRemoveController() throws SecurityException, NoSuchFieldException, IllegalArgumentException, 
        IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        
        Map<String, Object> props = new HashMap<>();
        props.put(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID, 25);
        Event event = new Event(ControllerMgr.TOPIC_CONTROLLER_REMOVED, props);

        Field controllerMapField = m_SUT.getClass().getDeclaredField("m_ControllerBundles");
        controllerMapField.setAccessible(true);
        
        Map<Integer, List<BundleModel>> controllerList = (Map<Integer, List<BundleModel>>)controllerMapField.get(m_SUT);
        assertThat(controllerList.keySet().size(), is(1));
        
        m_ControllerHelper.handleEvent(event);
        
        controllerList = (Map<Integer, List<BundleModel>>)controllerMapField.get(m_SUT);
        assertThat(controllerList.keySet().size(), is(0));
    }
/**
     * Test the controller event handler handling a controller removed event.
     * Verify that controller was removed from the local list of controllers.
     */
Test the controller event handler handling a controller removed event.
Verify that controller was removed from the local list of controllers.
Test the controller event handler handling a controller removed event . Verify that controller was removed from the local list of controllers .
@SuppressWarnings("unchecked")
    @Test
    public void testHandleRemoveController() throws SecurityException, NoSuchFieldException, IllegalArgumentException, 
        IllegalAccessException
    {
        m_SUT.getBundlesAsync(25);
        Map<String, Object> props = new HashMap<>();
        props.put(SharedPropertyConstants.EVENT_PROP_CONTROLLER_ID, 25);
        Event event = new Event(ControllerMgr.TOPIC_CONTROLLER_REMOVED, props);
        Field controllerMapField = m_SUT.getClass().getDeclaredField("m_ControllerBundles");
        controllerMapField.setAccessible(true);
        Map<Integer, List<BundleModel>> controllerList = (Map<Integer, List<BundleModel>>)controllerMapField.get(m_SUT);
        assertThat(controllerList.keySet().size(), is(1));
        m_ControllerHelper.handleEvent(event);
        controllerList = (Map<Integer, List<BundleModel>>)controllerMapField.get(m_SUT);
        assertThat(controllerList.keySet().size(), is(0));
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testHandleRemoveController ( ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException { m_SUT . getBundlesAsync ( 25 ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( SharedPropertyConstants . EVENT_PROP_CONTROLLER_ID , 25 ) ; Event event = new Event ( ControllerMgr . TOPIC_CONTROLLER_REMOVED , props ) ; Field controllerMapField = m_SUT . getClass ( ) . getDeclaredField ( "m_ControllerBundles" ) ; controllerMapField . setAccessible ( true ) ; Map < Integer , List < BundleModel > > controllerList = ( Map < Integer , List < BundleModel > > ) controllerMapField . get ( m_SUT ) ; assertThat ( controllerList . keySet ( ) . size ( ) , is ( 1 ) ) ; m_ControllerHelper . handleEvent ( event ) ; controllerList = ( Map < Integer , List < BundleModel > > ) controllerMapField . get ( m_SUT ) ; assertThat ( controllerList . keySet ( ) . size ( ) , is ( 0 ) ) ; }
Test the controller event handler handling a controller removed event.
Test the controller event handler handling a controller removed event .