mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestAbstractFactoryObject.java
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testSetProperties() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, IOException, ConfigurationException
    {
        Configuration config = ConfigurationAdminMocker.getConfigByPid(OBJ_PID);
       
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("test-prop", "test-value");
        m_SUT.setProperties(properties);

        ArgumentCaptor<Dictionary> dictionaryCap1 = ArgumentCaptor.forClass(Dictionary.class);
        verify(config, times(1)).update(dictionaryCap1.capture());
        assertThat((String)dictionaryCap1.getValue().get("test-prop"), is("test-value"));

        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();

        // set properties again, verify merge
        properties = new Hashtable<String, Object>();
        properties.put("test-prop", "test-value1");
        properties.put("test-prop2", "test-value2");
        properties.put("test-prop3", "test-value3");
        m_SUT.setProperties(properties);

        ArgumentCaptor<Dictionary> dictionaryCap2 = ArgumentCaptor.forClass(Dictionary.class);
        verify(config, times(2)).update(dictionaryCap2.capture());
        Dictionary<String, Object> capturedProperties = dictionaryCap2.getAllValues().get(1);
        
        assertThat((String)capturedProperties.get("test-prop"), is("test-value1"));
        assertThat((String)capturedProperties.get("test-prop2"), is("test-value2"));
        assertThat((String)capturedProperties.get("test-prop3"), is("test-value3"));

        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
    }
/**
     * Verify that set properties retrieves the correct properties.
     */
Verify that set properties retrieves the correct properties.
Verify that set properties retrieves the correct properties .
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testSetProperties() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, IOException, ConfigurationException
    {
        Configuration config = ConfigurationAdminMocker.getConfigByPid(OBJ_PID);
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("test-prop", "test-value");
        m_SUT.setProperties(properties);
        ArgumentCaptor<Dictionary> dictionaryCap1 = ArgumentCaptor.forClass(Dictionary.class);
        verify(config, times(1)).update(dictionaryCap1.capture());
        assertThat((String)dictionaryCap1.getValue().get("test-prop"), is("test-value"));
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
        properties = new Hashtable<String, Object>();
        properties.put("test-prop", "test-value1");
        properties.put("test-prop2", "test-value2");
        properties.put("test-prop3", "test-value3");
        m_SUT.setProperties(properties);
        ArgumentCaptor<Dictionary> dictionaryCap2 = ArgumentCaptor.forClass(Dictionary.class);
        verify(config, times(2)).update(dictionaryCap2.capture());
        Dictionary<String, Object> capturedProperties = dictionaryCap2.getAllValues().get(1);
        assertThat((String)capturedProperties.get("test-prop"), is("test-value1"));
        assertThat((String)capturedProperties.get("test-prop2"), is("test-value2"));
        assertThat((String)capturedProperties.get("test-prop3"), is("test-value3"));
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
    }
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Test public void testSetProperties ( ) throws IllegalArgumentException , IllegalStateException , FactoryException , IOException , ConfigurationException { Configuration config = ConfigurationAdminMocker . getConfigByPid ( OBJ_PID ) ; Map < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( "test-prop" , "test-value" ) ; m_SUT . setProperties ( properties ) ; ArgumentCaptor < Dictionary > dictionaryCap1 = ArgumentCaptor . forClass ( Dictionary . class ) ; verify ( config , times ( 1 ) ) . update ( dictionaryCap1 . capture ( ) ) ; assertThat ( ( String ) dictionaryCap1 . getValue ( ) . get ( "test-prop" ) , is ( "test-value" ) ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; properties = new Hashtable < String , Object > ( ) ; properties . put ( "test-prop" , "test-value1" ) ; properties . put ( "test-prop2" , "test-value2" ) ; properties . put ( "test-prop3" , "test-value3" ) ; m_SUT . setProperties ( properties ) ; ArgumentCaptor < Dictionary > dictionaryCap2 = ArgumentCaptor . forClass ( Dictionary . class ) ; verify ( config , times ( 2 ) ) . update ( dictionaryCap2 . capture ( ) ) ; Dictionary < String , Object > capturedProperties = dictionaryCap2 . getAllValues ( ) . get ( 1 ) ; assertThat ( ( String ) capturedProperties . get ( "test-prop" ) , is ( "test-value1" ) ) ; assertThat ( ( String ) capturedProperties . get ( "test-prop2" ) , is ( "test-value2" ) ) ; assertThat ( ( String ) capturedProperties . get ( "test-prop3" ) , is ( "test-value3" ) ) ; verify ( m_WakeLock , times ( 2 ) ) . activate ( ) ; verify ( m_WakeLock , times ( 2 ) ) . cancel ( ) ; }
Verify that set properties retrieves the correct properties.
Verify that set properties retrieves the correct properties .
// set properties again, verify merge