mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestCreateFactoryConfiguration.java
@Test
    public void testGetSetPropertiesList()
    {
        //test set up
        UnmodifiableConfigMetatypeModel model = mock(UnmodifiableConfigMetatypeModel.class);
        //create dummy models
        ConfigPropModelImpl configModel1 = ModelFactory.createPropModel("imma key", "imma value");
        ConfigPropModelImpl configModel2 = ModelFactory.createPropModel("key", "value");

        //add models to list
        List<UnmodifiablePropertyModel> propModels = new ArrayList<UnmodifiablePropertyModel>();
        propModels.add(configModel1);
        propModels.add(configModel2);
        when(model.getProperties()).thenReturn(propModels);
        
        //ensure properties list has not been set
        assertThat(m_SUT.getPropertiesList(), is(nullValue()));
        
        m_SUT.setPropertiesList(model, "pid", 123);
        
        List<ModifiablePropertyModel> propsList = m_SUT.getPropertiesList();
        assertThat(propsList.size(), is(2));
        
        ModifiablePropertyModel retModel1 = propsList.get(0);
        assertThat(retModel1.getName(), is(configModel1.getName()));
        assertThat(retModel1.getKey(), is(configModel1.getKey()));
        assertThat(retModel1.getCardinality(), is(configModel1.getCardinality()));
        assertThat(retModel1.getDescription(), is(configModel1.getDescription()));
        assertThat(retModel1.getValue(), is(configModel1.getValue()));
        
        ModifiablePropertyModel retModel2 = propsList.get(1);
        assertThat(retModel2.getKey(), is(configModel2.getKey()));
        assertThat(retModel2.getName(), is(configModel2.getName()));
        assertThat(retModel2.getValue(), is(configModel2.getValue()));
        assertThat(retModel2.getCardinality(), is(configModel2.getCardinality()));
        assertThat(retModel2.getDescription(), is(configModel2.getDescription()));
    }
/**
     * Verify property list can be set.
     * Verify contents of property list are correct. 
     */
Verify property list can be set.
Verify contents of property list are correct.
Verify property list can be set . Verify contents of property list are correct .
@Test
    public void testGetSetPropertiesList()
    {
        UnmodifiableConfigMetatypeModel model = mock(UnmodifiableConfigMetatypeModel.class);
        ConfigPropModelImpl configModel1 = ModelFactory.createPropModel("imma key", "imma value");
        ConfigPropModelImpl configModel2 = ModelFactory.createPropModel("key", "value");
        List<UnmodifiablePropertyModel> propModels = new ArrayList<UnmodifiablePropertyModel>();
        propModels.add(configModel1);
        propModels.add(configModel2);
        when(model.getProperties()).thenReturn(propModels);
        assertThat(m_SUT.getPropertiesList(), is(nullValue()));
        m_SUT.setPropertiesList(model, "pid", 123);
        List<ModifiablePropertyModel> propsList = m_SUT.getPropertiesList();
        assertThat(propsList.size(), is(2));
        ModifiablePropertyModel retModel1 = propsList.get(0);
        assertThat(retModel1.getName(), is(configModel1.getName()));
        assertThat(retModel1.getKey(), is(configModel1.getKey()));
        assertThat(retModel1.getCardinality(), is(configModel1.getCardinality()));
        assertThat(retModel1.getDescription(), is(configModel1.getDescription()));
        assertThat(retModel1.getValue(), is(configModel1.getValue()));
        ModifiablePropertyModel retModel2 = propsList.get(1);
        assertThat(retModel2.getKey(), is(configModel2.getKey()));
        assertThat(retModel2.getName(), is(configModel2.getName()));
        assertThat(retModel2.getValue(), is(configModel2.getValue()));
        assertThat(retModel2.getCardinality(), is(configModel2.getCardinality()));
        assertThat(retModel2.getDescription(), is(configModel2.getDescription()));
    }
@ Test public void testGetSetPropertiesList ( ) { UnmodifiableConfigMetatypeModel model = mock ( UnmodifiableConfigMetatypeModel . class ) ; ConfigPropModelImpl configModel1 = ModelFactory . createPropModel ( "imma key" , "imma value" ) ; ConfigPropModelImpl configModel2 = ModelFactory . createPropModel ( "key" , "value" ) ; List < UnmodifiablePropertyModel > propModels = new ArrayList < UnmodifiablePropertyModel > ( ) ; propModels . add ( configModel1 ) ; propModels . add ( configModel2 ) ; when ( model . getProperties ( ) ) . thenReturn ( propModels ) ; assertThat ( m_SUT . getPropertiesList ( ) , is ( nullValue ( ) ) ) ; m_SUT . setPropertiesList ( model , "pid" , 123 ) ; List < ModifiablePropertyModel > propsList = m_SUT . getPropertiesList ( ) ; assertThat ( propsList . size ( ) , is ( 2 ) ) ; ModifiablePropertyModel retModel1 = propsList . get ( 0 ) ; assertThat ( retModel1 . getName ( ) , is ( configModel1 . getName ( ) ) ) ; assertThat ( retModel1 . getKey ( ) , is ( configModel1 . getKey ( ) ) ) ; assertThat ( retModel1 . getCardinality ( ) , is ( configModel1 . getCardinality ( ) ) ) ; assertThat ( retModel1 . getDescription ( ) , is ( configModel1 . getDescription ( ) ) ) ; assertThat ( retModel1 . getValue ( ) , is ( configModel1 . getValue ( ) ) ) ; ModifiablePropertyModel retModel2 = propsList . get ( 1 ) ; assertThat ( retModel2 . getKey ( ) , is ( configModel2 . getKey ( ) ) ) ; assertThat ( retModel2 . getName ( ) , is ( configModel2 . getName ( ) ) ) ; assertThat ( retModel2 . getValue ( ) , is ( configModel2 . getValue ( ) ) ) ; assertThat ( retModel2 . getCardinality ( ) , is ( configModel2 . getCardinality ( ) ) ) ; assertThat ( retModel2 . getDescription ( ) , is ( configModel2 . getDescription ( ) ) ) ; }
Verify property list can be set.
Verify property list can be set .
//test set up //create dummy models //add models to list //ensure properties list has not been set