mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestAssetDirectoryService.java
public final void testAssetStatusChange() throws InterruptedException, IllegalArgumentException, AssetException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName(), "statusAsset");

        AssetStatusEventHandler statusEventHandler = new AssetStatusEventHandler();
        EventHandlerSyncer statusChangeSync = new EventHandlerSyncer(m_Context, Asset.TOPIC_STATUS_CHANGED,
            String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_UUID, asset.getUuid()),
            statusEventHandler);
        
        AssetUtils.activateAsset(m_Context, asset, 5);
        
        statusChangeSync.waitForEvent(5);
        
        //asset status
        Observation status = asset.getLastStatus();
        Status fromHandler = statusEventHandler.getAssetStatus();
        assertThat(fromHandler, is(notNullValue()));
        assertThat(status.getStatus().getNextStatusDurationMs(), is(100));
        assertThat(status.getStatus().getSummaryStatus().getSummary(), 
                is(fromHandler.getSummaryStatus().getSummary()));
        assertThat(status.getStatus().getSummaryStatus().getDescription(), 
                is(fromHandler.getSummaryStatus().getDescription()));
        
        AssetUtils.deactivateAsset(m_Context, asset);
    }
/**
     * Verify that when an Asset's status changes that an event is posted.
     * Verify the status in the event contains a message, and that the event status data matches that
     * which returned when the status is directly requested.
     */
Verify that when an Asset's status changes that an event is posted.
Verify the status in the event contains a message, and that the event status data matches that
which returned when the status is directly requested.
Verify that when an Asset ' s status changes that an event is posted . Verify the status in the event contains a message and that the event status data matches that which returned when the status is directly requested .
public final void testAssetStatusChange() throws InterruptedException, IllegalArgumentException, AssetException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName(), "statusAsset");
        AssetStatusEventHandler statusEventHandler = new AssetStatusEventHandler();
        EventHandlerSyncer statusChangeSync = new EventHandlerSyncer(m_Context, Asset.TOPIC_STATUS_CHANGED,
            String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_UUID, asset.getUuid()),
            statusEventHandler);
        AssetUtils.activateAsset(m_Context, asset, 5);
        statusChangeSync.waitForEvent(5);
        Observation status = asset.getLastStatus();
        Status fromHandler = statusEventHandler.getAssetStatus();
        assertThat(fromHandler, is(notNullValue()));
        assertThat(status.getStatus().getNextStatusDurationMs(), is(100));
        assertThat(status.getStatus().getSummaryStatus().getSummary(), 
                is(fromHandler.getSummaryStatus().getSummary()));
        assertThat(status.getStatus().getSummaryStatus().getDescription(), 
                is(fromHandler.getSummaryStatus().getDescription()));
        AssetUtils.deactivateAsset(m_Context, asset);
    }
public final void testAssetStatusChange ( ) throws InterruptedException , IllegalArgumentException , AssetException { AssetDirectoryService assetDirectoryService = ServiceUtils . getService ( m_Context , AssetDirectoryService . class ) ; assertThat ( assetDirectoryService , is ( notNullValue ( ) ) ) ; Asset asset = assetDirectoryService . createAsset ( ExampleAsset . class . getName ( ) , "statusAsset" ) ; AssetStatusEventHandler statusEventHandler = new AssetStatusEventHandler ( ) ; EventHandlerSyncer statusChangeSync = new EventHandlerSyncer ( m_Context , Asset . TOPIC_STATUS_CHANGED , String . format ( "(%s=%s)" , FactoryDescriptor . EVENT_PROP_OBJ_UUID , asset . getUuid ( ) ) , statusEventHandler ) ; AssetUtils . activateAsset ( m_Context , asset , 5 ) ; statusChangeSync . waitForEvent ( 5 ) ; Observation status = asset . getLastStatus ( ) ; Status fromHandler = statusEventHandler . getAssetStatus ( ) ; assertThat ( fromHandler , is ( notNullValue ( ) ) ) ; assertThat ( status . getStatus ( ) . getNextStatusDurationMs ( ) , is ( 100 ) ) ; assertThat ( status . getStatus ( ) . getSummaryStatus ( ) . getSummary ( ) , is ( fromHandler . getSummaryStatus ( ) . getSummary ( ) ) ) ; assertThat ( status . getStatus ( ) . getSummaryStatus ( ) . getDescription ( ) , is ( fromHandler . getSummaryStatus ( ) . getDescription ( ) ) ) ; AssetUtils . deactivateAsset ( m_Context , asset ) ; }
Verify that when an Asset's status changes that an event is posted.
Verify that when an Asset ' s status changes that an event is posted .
//asset status