mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/observation/TestRemoteObservationListener.java
@SuppressWarnings("unchecked")
    @Test
    public void testConfiguration()
    {
        //prop map simulating the enabled property is updated to false
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("enabled", false);
        m_SUT.modified(props);

        //verify
        verify(m_HandlerReg, times(2)).unregister();

        //mock null property
        when(m_Context.getProperty(RemoteObservationListener.ENABLED_FRAMEWORK_PROPERTY)).thenReturn(null);

        //call update again, since the enable property isn't in the map should use framework property
        props = new HashMap<String, Object>();
        m_SUT.modified(props);

        //verify, handlers registered again.
        
        verify(m_Context, times(4)).registerService(eq(EventHandler.class), Mockito.any(EventHandler.class), 
            Mockito.any(Dictionary.class));
    }
/**
     * Test the ability for the component to be configured. 
     * Verify properties are updated.
     * Verify default of true if property is not set in config file.
     */
Test the ability for the component to be configured.
Verify properties are updated.
Verify default of true if property is not set in config file.
Test the ability for the component to be configured . Verify properties are updated . Verify default of true if property is not set in config file .
@SuppressWarnings("unchecked")
    @Test
    public void testConfiguration()
    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("enabled", false);
        m_SUT.modified(props);
        verify(m_HandlerReg, times(2)).unregister();
        when(m_Context.getProperty(RemoteObservationListener.ENABLED_FRAMEWORK_PROPERTY)).thenReturn(null);
        props = new HashMap<String, Object>();
        m_SUT.modified(props);
        , handlers registered again.
        verify(m_Context, times(4)).registerService(eq(EventHandler.class), Mockito.any(EventHandler.class), 
            Mockito.any(Dictionary.class));
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testConfiguration ( ) { Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( "enabled" , false ) ; m_SUT . modified ( props ) ; verify ( m_HandlerReg , times ( 2 ) ) . unregister ( ) ; when ( m_Context . getProperty ( RemoteObservationListener . ENABLED_FRAMEWORK_PROPERTY ) ) . thenReturn ( null ) ; props = new HashMap < String , Object > ( ) ; m_SUT . modified ( props ) ; verify ( m_Context , times ( 4 ) ) . registerService ( eq ( EventHandler . class ) , Mockito . any ( EventHandler . class ) , Mockito . any ( Dictionary . class ) ) ; }
Test the ability for the component to be configured.
Test the ability for the component to be configured .
//prop map simulating the enabled property is updated to false //verify //mock null property //call update again, since the enable property isn't in the map should use framework property //verify, handlers registered again.