mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryServiceUtils.java
@Test
    public void testGetMetaTypeDefaults()
    {
        when(m_Factory.getAttributeDefinitions(ObjectClassDefinition.ALL)).thenReturn(m_ADs);
        
        Dictionary<String, Object> retrieved = m_SUT.getMetaTypeDefaults(m_Factory);
        
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), hasKey("attr1"));
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), hasKey("attr2"));
        // empty string should not be added
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), not(hasKey("attr3"))); 
        assertThat(retrieved.get("attr1"), is((Object)"default1"));
        assertThat(retrieved.get("attr2"), is((Object)"default2"));
    }
/**
     * Verify ability to get metatype defaults of a factory.
     */
Verify ability to get metatype defaults of a factory.
Verify ability to get metatype defaults of a factory .
@Test
    public void testGetMetaTypeDefaults()
    {
        when(m_Factory.getAttributeDefinitions(ObjectClassDefinition.ALL)).thenReturn(m_ADs);
        Dictionary<String, Object> retrieved = m_SUT.getMetaTypeDefaults(m_Factory);
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), hasKey("attr1"));
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), hasKey("attr2"));
        assertThat(ConfigurationUtils.convertDictionaryPropsToMap(retrieved), not(hasKey("attr3"))); 
        assertThat(retrieved.get("attr1"), is((Object)"default1"));
        assertThat(retrieved.get("attr2"), is((Object)"default2"));
    }
@ Test public void testGetMetaTypeDefaults ( ) { when ( m_Factory . getAttributeDefinitions ( ObjectClassDefinition . ALL ) ) . thenReturn ( m_ADs ) ; Dictionary < String , Object > retrieved = m_SUT . getMetaTypeDefaults ( m_Factory ) ; assertThat ( ConfigurationUtils . convertDictionaryPropsToMap ( retrieved ) , hasKey ( "attr1" ) ) ; assertThat ( ConfigurationUtils . convertDictionaryPropsToMap ( retrieved ) , hasKey ( "attr2" ) ) ; assertThat ( ConfigurationUtils . convertDictionaryPropsToMap ( retrieved ) , not ( hasKey ( "attr3" ) ) ) ; assertThat ( retrieved . get ( "attr1" ) , is ( ( Object ) "default1" ) ) ; assertThat ( retrieved . get ( "attr2" ) , is ( ( Object ) "default2" ) ) ; }
Verify ability to get metatype defaults of a factory.
Verify ability to get metatype defaults of a factory .
// empty string should not be added