mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestAssetNamespace.java
@Test
    public final void testCaptureData_SensorId() throws IOException, AssetException, ObjectConverterException, 
        InterruptedException
    {
        CreateAssetResponseData createAssetResponse = AssetNamespaceUtils.createAsset(socket,
                ExampleCommandAsset.class.getName(), null, null);
        SharedMessages.UUID sensorAssetUuid = createAssetResponse.getInfo().getUuid();

        MessageListener listener = new MessageListener(socket);

        // build request
        CaptureDataRequestData request = CaptureDataRequestData.newBuilder()
                .setUuid(sensorAssetUuid)
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.UUID_ONLY)
                .setSensorId("sensor-id")
                .build();        
        
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetMessage(
                AssetMessageType.CaptureDataRequest, request);         
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        Message responseRcvd = listener.waitForMessage(Namespace.Asset, 
                AssetMessageType.CaptureDataResponse, 1200);  
        AssetNamespace response = (AssetNamespace)responseRcvd;
        CaptureDataResponseData dataResponse = CaptureDataResponseData.parseFrom(response.getData());
        
        //ensure that observation UUID is set
        assertThat(dataResponse.getObservationCase(), is(ObservationCase.OBSERVATIONUUID));
        assertThat(dataResponse.hasObservationUuid(), is(true));
        assertThat(dataResponse.getSensorId(), is("sensor-id"));

        AssetNamespaceUtils.removeAsset(socket, sensorAssetUuid);
    }
/**
     * Verifies ability of the system to have an asset remotely capture data with the sensor ID parameter. 
     */
Verifies ability of the system to have an asset remotely capture data with the sensor ID parameter.
Verifies ability of the system to have an asset remotely capture data with the sensor ID parameter .
@Test
    public final void testCaptureData_SensorId() throws IOException, AssetException, ObjectConverterException, 
        InterruptedException
    {
        CreateAssetResponseData createAssetResponse = AssetNamespaceUtils.createAsset(socket,
                ExampleCommandAsset.class.getName(), null, null);
        SharedMessages.UUID sensorAssetUuid = createAssetResponse.getInfo().getUuid();
        MessageListener listener = new MessageListener(socket);
        CaptureDataRequestData request = CaptureDataRequestData.newBuilder()
                .setUuid(sensorAssetUuid)
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.UUID_ONLY)
                .setSensorId("sensor-id")
                .build();        
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetMessage(
                AssetMessageType.CaptureDataRequest, request);         
        message.writeDelimitedTo(socket.getOutputStream());
        Message responseRcvd = listener.waitForMessage(Namespace.Asset, 
                AssetMessageType.CaptureDataResponse, 1200);  
        AssetNamespace response = (AssetNamespace)responseRcvd;
        CaptureDataResponseData dataResponse = CaptureDataResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getObservationCase(), is(ObservationCase.OBSERVATIONUUID));
        assertThat(dataResponse.hasObservationUuid(), is(true));
        assertThat(dataResponse.getSensorId(), is("sensor-id"));
        AssetNamespaceUtils.removeAsset(socket, sensorAssetUuid);
    }
@ Test public final void testCaptureData_SensorId ( ) throws IOException , AssetException , ObjectConverterException , InterruptedException { CreateAssetResponseData createAssetResponse = AssetNamespaceUtils . createAsset ( socket , ExampleCommandAsset . class . getName ( ) , null , null ) ; SharedMessages . UUID sensorAssetUuid = createAssetResponse . getInfo ( ) . getUuid ( ) ; MessageListener listener = new MessageListener ( socket ) ; CaptureDataRequestData request = CaptureDataRequestData . newBuilder ( ) . setUuid ( sensorAssetUuid ) . setObservationFormat ( RemoteTypesGen . LexiconFormat . Enum . UUID_ONLY ) . setSensorId ( "sensor-id" ) . build ( ) ; TerraHarvestMessage message = AssetNamespaceUtils . createAssetMessage ( AssetMessageType . CaptureDataRequest , request ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message responseRcvd = listener . waitForMessage ( Namespace . Asset , AssetMessageType . CaptureDataResponse , 1200 ) ; AssetNamespace response = ( AssetNamespace ) responseRcvd ; CaptureDataResponseData dataResponse = CaptureDataResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getObservationCase ( ) , is ( ObservationCase . OBSERVATIONUUID ) ) ; assertThat ( dataResponse . hasObservationUuid ( ) , is ( true ) ) ; assertThat ( dataResponse . getSensorId ( ) , is ( "sensor-id" ) ) ; AssetNamespaceUtils . removeAsset ( socket , sensorAssetUuid ) ; }
Verifies ability of the system to have an asset remotely capture data with the sensor ID parameter.
Verifies ability of the system to have an asset remotely capture data with the sensor ID parameter .
// build request //listen for messages for a specific time interval //ensure that observation UUID is set