mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestFactoryObject.java
public void testCreation_NoDefaults() throws IllegalArgumentException, AssetException, 
        IllegalStateException, FactoryException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        
        Map<String, Object> properties = asset.getProperties();
        //verify that initial creation does not add in props that are not required
        assertThat(properties.keySet(), not(hasItem(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME)));

        //set the activate property
        properties.put(ExampleAssetAttributes.CONFIG_PROP_ACTIVATE_ON_STARTUP, true);
        asset.setProperties(properties);

        //Verify that setting a property did not introduce the default, of a property that was not set.
        //This is done to ensure that the act of setting a property whether to its default or not,
        //does not introduce other property's values which were not previously set to values
        //different than their defaults into the map of known properties.
        assertThat(asset.getProperties().keySet(), not(hasItem(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME)));
    }
/**
     * Verify that at creation default property values are not included as a property if not set.
     * Verify that after updating a property, that defaults for properties which were not set do not get included
     * into the created configuration.
     */
Verify that at creation default property values are not included as a property if not set.
Verify that after updating a property, that defaults for properties which were not set do not get included
into the created configuration.
Verify that at creation default property values are not included as a property if not set . Verify that after updating a property that defaults for properties which were not set do not get included into the created configuration .
public void testCreation_NoDefaults() throws IllegalArgumentException, AssetException, 
        IllegalStateException, FactoryException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        Map<String, Object> properties = asset.getProperties();
        assertThat(properties.keySet(), not(hasItem(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME)));
        properties.put(ExampleAssetAttributes.CONFIG_PROP_ACTIVATE_ON_STARTUP, true);
        asset.setProperties(properties);
        assertThat(asset.getProperties().keySet(), not(hasItem(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME)));
    }
public void testCreation_NoDefaults ( ) throws IllegalArgumentException , AssetException , IllegalStateException , FactoryException { AssetDirectoryService assetDirectoryService = ServiceUtils . getService ( m_Context , AssetDirectoryService . class ) ; assertThat ( assetDirectoryService , is ( notNullValue ( ) ) ) ; Asset asset = assetDirectoryService . createAsset ( ExampleAsset . class . getName ( ) ) ; Map < String , Object > properties = asset . getProperties ( ) ; assertThat ( properties . keySet ( ) , not ( hasItem ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME ) ) ) ; properties . put ( ExampleAssetAttributes . CONFIG_PROP_ACTIVATE_ON_STARTUP , true ) ; asset . setProperties ( properties ) ; assertThat ( asset . getProperties ( ) . keySet ( ) , not ( hasItem ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME ) ) ) ; }
Verify that at creation default property values are not included as a property if not set.
Verify that at creation default property values are not included as a property if not set .
//verify that initial creation does not add in props that are not required //set the activate property //Verify that setting a property did not introduce the default, of a property that was not set. //This is done to ensure that the act of setting a property whether to its default or not, //does not introduce other property's values which were not previously set to values //different than their defaults into the map of known properties.