mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestAssetDirectoryService.java
public final void testAssetCaptureData() throws InterruptedException, IllegalArgumentException, AssetException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Asset.TOPIC_DATA_CAPTURED,
                String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_UUID, asset.getUuid().toString()));
        
        Observation observation = asset.captureData();
        
        Event event = syncer.waitForEvent(5);
        
        ObservationStore observationStore = ServiceUtils.getService(m_Context, ObservationStore.class);
        assertThat(observationStore.find(observation.getUuid()), is(notNullValue()));
        
        String baseType = event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE).toString();
        assertThat(baseType, is("Asset"));
    }
/**
     * Verify that an asset can be requested to capture data.
     * Verify an Observation is posted after the request is made.
     * Verify the correct object base type for the event.
     */
Verify that an asset can be requested to capture data.
Verify an Observation is posted after the request is made.
Verify the correct object base type for the event.
Verify that an asset can be requested to capture data . Verify an Observation is posted after the request is made . Verify the correct object base type for the event .
public final void testAssetCaptureData() throws InterruptedException, IllegalArgumentException, AssetException
    {
        AssetDirectoryService assetDirectoryService = ServiceUtils.getService(m_Context, AssetDirectoryService.class);
        assertThat(assetDirectoryService, is(notNullValue()));
        Asset asset = assetDirectoryService.createAsset(ExampleAsset.class.getName());
        EventHandlerSyncer syncer = new EventHandlerSyncer(m_Context, Asset.TOPIC_DATA_CAPTURED,
                String.format("(%s=%s)", FactoryDescriptor.EVENT_PROP_OBJ_UUID, asset.getUuid().toString()));
        Observation observation = asset.captureData();
        Event event = syncer.waitForEvent(5);
        ObservationStore observationStore = ServiceUtils.getService(m_Context, ObservationStore.class);
        assertThat(observationStore.find(observation.getUuid()), is(notNullValue()));
        String baseType = event.getProperty(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE).toString();
        assertThat(baseType, is("Asset"));
    }
public final void testAssetCaptureData ( ) throws InterruptedException , IllegalArgumentException , AssetException { AssetDirectoryService assetDirectoryService = ServiceUtils . getService ( m_Context , AssetDirectoryService . class ) ; assertThat ( assetDirectoryService , is ( notNullValue ( ) ) ) ; Asset asset = assetDirectoryService . createAsset ( ExampleAsset . class . getName ( ) ) ; EventHandlerSyncer syncer = new EventHandlerSyncer ( m_Context , Asset . TOPIC_DATA_CAPTURED , String . format ( "(%s=%s)" , FactoryDescriptor . EVENT_PROP_OBJ_UUID , asset . getUuid ( ) . toString ( ) ) ) ; Observation observation = asset . captureData ( ) ; Event event = syncer . waitForEvent ( 5 ) ; ObservationStore observationStore = ServiceUtils . getService ( m_Context , ObservationStore . class ) ; assertThat ( observationStore . find ( observation . getUuid ( ) ) , is ( notNullValue ( ) ) ) ; String baseType = event . getProperty ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE ) . toString ( ) ; assertThat ( baseType , is ( "Asset" ) ) ; }
Verify that an asset can be requested to capture data.
Verify that an asset can be requested to capture data .