mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestAssetDirectoryService.java
public final void testActivateDeactivate() throws Exception
    {
        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();
        properties.put(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, "exampleA");
        asset.setProperties(properties);
        
        AssetUtils.activateAsset(m_Context, asset, 5);
        
        AssetUtils.deactivateAsset(m_Context, asset);
    }
/**
     * Verify once asset is added they can be activated/deactivated.
     */
Verify once asset is added they can be activated/deactivated.
Verify once asset is added they can be activated / deactivated .
public final void testActivateDeactivate() throws Exception
    {
        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();
        properties.put(ExampleAssetAttributes.CONFIG_PROP_DEVICE_POWER_NAME, "exampleA");
        asset.setProperties(properties);
        AssetUtils.activateAsset(m_Context, asset, 5);
        AssetUtils.deactivateAsset(m_Context, asset);
    }
public final void testActivateDeactivate ( ) throws Exception { 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 ( ) ; properties . put ( ExampleAssetAttributes . CONFIG_PROP_DEVICE_POWER_NAME , "exampleA" ) ; asset . setProperties ( properties ) ; AssetUtils . activateAsset ( m_Context , asset , 5 ) ; AssetUtils . deactivateAsset ( m_Context , asset ) ; }
Verify once asset is added they can be activated/deactivated.
Verify once asset is added they can be activated / deactivated .