mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestConfigurationWrapperImpl.java
@Test
    public void testFindChangedProperties()
    {
        List<ModifiablePropertyModel> properties = new ArrayList<ModifiablePropertyModel>();
        properties.add(ModelFactory.createPropModel("name", "Bill"));
        properties.add(ModelFactory.createPropModel("otherkey", "JimBob"));
        
        List<ModifiablePropertyModel> changed = m_SUT.findChangedPropertiesAsync(25, "some factory config", properties);
        
        assertThat(changed.size(), is(2));
        assertThat(changed.get(0).getKey(), is("name"));
        assertThat(changed.get(1).getKey(), is("otherkey"));
        
        assertThat((String)changed.get(0).getValue(), is("Bill"));
        assertThat((String)changed.get(1).getValue(), is("JimBob"));
        
        properties.clear();
        properties.add(ModelFactory.createPropModel("name", "some name"));
        
        changed = m_SUT.findChangedPropertiesAsync(25,  "some factory config", properties);
        assertThat(changed.size(), is(0));
        
        try
        {
            changed = m_SUT.findChangedPropertiesAsync(25, "nonexistentpid", properties);
            fail("Expecting no meta type information currently available exception.");
        }
        catch (IllegalArgumentException exception)
        {
            //expecting an illegal argument exception
        }
    }
/**
     * Verify that the correct list of changed properties is returned.
     */
Verify that the correct list of changed properties is returned.
Verify that the correct list of changed properties is returned .
@Test
    public void testFindChangedProperties()
    {
        List<ModifiablePropertyModel> properties = new ArrayList<ModifiablePropertyModel>();
        properties.add(ModelFactory.createPropModel("name", "Bill"));
        properties.add(ModelFactory.createPropModel("otherkey", "JimBob"));
        List<ModifiablePropertyModel> changed = m_SUT.findChangedPropertiesAsync(25, "some factory config", properties);
        assertThat(changed.size(), is(2));
        assertThat(changed.get(0).getKey(), is("name"));
        assertThat(changed.get(1).getKey(), is("otherkey"));
        assertThat((String)changed.get(0).getValue(), is("Bill"));
        assertThat((String)changed.get(1).getValue(), is("JimBob"));
        properties.clear();
        properties.add(ModelFactory.createPropModel("name", "some name"));
        changed = m_SUT.findChangedPropertiesAsync(25,  "some factory config", properties);
        assertThat(changed.size(), is(0));
        try
        {
            changed = m_SUT.findChangedPropertiesAsync(25, "nonexistentpid", properties);
            fail("Expecting no meta type information currently available exception.");
        }
        catch (IllegalArgumentException exception)
        {
        }
    }
@ Test public void testFindChangedProperties ( ) { List < ModifiablePropertyModel > properties = new ArrayList < ModifiablePropertyModel > ( ) ; properties . add ( ModelFactory . createPropModel ( "name" , "Bill" ) ) ; properties . add ( ModelFactory . createPropModel ( "otherkey" , "JimBob" ) ) ; List < ModifiablePropertyModel > changed = m_SUT . findChangedPropertiesAsync ( 25 , "some factory config" , properties ) ; assertThat ( changed . size ( ) , is ( 2 ) ) ; assertThat ( changed . get ( 0 ) . getKey ( ) , is ( "name" ) ) ; assertThat ( changed . get ( 1 ) . getKey ( ) , is ( "otherkey" ) ) ; assertThat ( ( String ) changed . get ( 0 ) . getValue ( ) , is ( "Bill" ) ) ; assertThat ( ( String ) changed . get ( 1 ) . getValue ( ) , is ( "JimBob" ) ) ; properties . clear ( ) ; properties . add ( ModelFactory . createPropModel ( "name" , "some name" ) ) ; changed = m_SUT . findChangedPropertiesAsync ( 25 , "some factory config" , properties ) ; assertThat ( changed . size ( ) , is ( 0 ) ) ; try { changed = m_SUT . findChangedPropertiesAsync ( 25 , "nonexistentpid" , properties ) ; fail ( "Expecting no meta type information currently available exception." ) ; } catch ( IllegalArgumentException exception ) { } }
Verify that the correct list of changed properties is returned.
Verify that the correct list of changed properties is returned .
//expecting an illegal argument exception