mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestPowerManager.java
public void testCreateWakeLockWithFactoryObject() throws IllegalArgumentException, AssetException
    {
        PowerManager powerManager = ServiceUtils.getService(m_Context, PowerManager.class);
        assertThat(powerManager, notNullValue());
        
        // fetch AssetDirectoryService to create factory object
        AssetDirectoryService assetDirService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirService, is(notNullValue()));
        
        // Create test factory object
        Asset sourceObject = assetDirService.createAsset(ExampleAsset.class.getName());
        
        try
        {
            // Create WakeLock (created by asset during activation)
            AssetUtils.activateAsset(m_Context, sourceObject, 5);
            
            // Check that the FactoryObject created lock is present in the WakeLock list retrieved by context.
            Set<WakeLock> currentLocks = powerManager.getWakeLocks(ExampleAsset.class, WakeLockState.Inactive);
            printWakeLocks(currentLocks);
            // make sure there is at least 1, might be more if other ExampleAssets have been activated
            assertThat("FactoryObject wake locks not found", currentLocks.size() >= 1);
        }
        finally
        {
            // can't remove all assets as this class runs after the test prep for 2nd run class (but during the first 
            // run)
            AssetUtils.deleteAsset(m_Context, sourceObject);
        }
    }
/**
     * Verifies that a WakeLock can be created given the source {@link mil.dod.th.core.factory.FactoryObject} AND
     * later retrieved by the asset type.
     */
Verifies that a WakeLock can be created given the source  mil.dod.th.core.factory.FactoryObject AND
later retrieved by the asset type.
Verifies that a WakeLock can be created given the source mil . dod . th . core . factory . FactoryObject AND later retrieved by the asset type .
public void testCreateWakeLockWithFactoryObject() throws IllegalArgumentException, AssetException
    {
        PowerManager powerManager = ServiceUtils.getService(m_Context, PowerManager.class);
        assertThat(powerManager, notNullValue());
        AssetDirectoryService assetDirService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirService, is(notNullValue()));
        Asset sourceObject = assetDirService.createAsset(ExampleAsset.class.getName());
        try
        {
            AssetUtils.activateAsset(m_Context, sourceObject, 5);
            Set<WakeLock> currentLocks = powerManager.getWakeLocks(ExampleAsset.class, WakeLockState.Inactive);
            printWakeLocks(currentLocks);
            assertThat("FactoryObject wake locks not found", currentLocks.size() >= 1);
        }
        finally
        {
            AssetUtils.deleteAsset(m_Context, sourceObject);
        }
    }
public void testCreateWakeLockWithFactoryObject ( ) throws IllegalArgumentException , AssetException { PowerManager powerManager = ServiceUtils . getService ( m_Context , PowerManager . class ) ; assertThat ( powerManager , notNullValue ( ) ) ; AssetDirectoryService assetDirService = ServiceUtils . getService ( m_Context , AssetDirectoryService . class ) ; assertThat ( assetDirService , is ( notNullValue ( ) ) ) ; Asset sourceObject = assetDirService . createAsset ( ExampleAsset . class . getName ( ) ) ; try { AssetUtils . activateAsset ( m_Context , sourceObject , 5 ) ; Set < WakeLock > currentLocks = powerManager . getWakeLocks ( ExampleAsset . class , WakeLockState . Inactive ) ; printWakeLocks ( currentLocks ) ; assertThat ( "FactoryObject wake locks not found" , currentLocks . size ( ) >= 1 ) ; } finally { AssetUtils . deleteAsset ( m_Context , sourceObject ) ; } }
Verifies that a WakeLock can be created given the source {@link mil.dod.th.core.factory.FactoryObject} AND
 later retrieved by the asset type.
Verifies that a WakeLock can be created given the source { @link mil . dod . th . core . factory . FactoryObject } AND later retrieved by the asset type .
// fetch AssetDirectoryService to create factory object // Create test factory object // Create WakeLock (created by asset during activation) // Check that the FactoryObject created lock is present in the WakeLock list retrieved by context. // make sure there is at least 1, might be more if other ExampleAssets have been activated // can't remove all assets as this class runs after the test prep for 2nd run class (but during the first  // run)