mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestAssetNamespace.java
@Test
    public final void testCaptureData_ObsResponse() throws IOException, AssetException, ObjectConverterException, 
        InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        // build request
        CaptureDataRequestData request = CaptureDataRequestData.newBuilder().
                setUuid(testUuid).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.getObservationUuid(), is(notNullValue()));
        
        //ensure that observation data is set
        assertThat(dataResponse.getObservationCase(), is(ObservationCase.OBSERVATIONNATIVE)); 
        assertThat(dataResponse.getObservationNative().getAssetLocation().getLatitude().getValue(), is(74.0));
        assertThat(dataResponse.getObservationNative().getAssetLocation().getLongitude().getValue(), is(54.0));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetId(), is("example-target-id"));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetFrequency().getValue(), is((double)30));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetLocation().getLatitude().getValue(), 
                is(50.0));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetLocation().getLongitude().getValue(), 
                is(70.0));
    }
/**
     * Verifies ability of the system to have an asset remotely capture data. 
     */
Verifies ability of the system to have an asset remotely capture data.
Verifies ability of the system to have an asset remotely capture data .
@Test
    public final void testCaptureData_ObsResponse() throws IOException, AssetException, ObjectConverterException, 
        InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        CaptureDataRequestData request = CaptureDataRequestData.newBuilder().
                setUuid(testUuid).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.getObservationUuid(), is(notNullValue()));
        assertThat(dataResponse.getObservationCase(), is(ObservationCase.OBSERVATIONNATIVE)); 
        assertThat(dataResponse.getObservationNative().getAssetLocation().getLatitude().getValue(), is(74.0));
        assertThat(dataResponse.getObservationNative().getAssetLocation().getLongitude().getValue(), is(54.0));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetId(), is("example-target-id"));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetFrequency().getValue(), is((double)30));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetLocation().getLatitude().getValue(), 
                is(50.0));
        assertThat(dataResponse.getObservationNative().getDetection().getTargetLocation().getLongitude().getValue(), 
                is(70.0));
    }
@ Test public final void testCaptureData_ObsResponse ( ) throws IOException , AssetException , ObjectConverterException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; CaptureDataRequestData request = CaptureDataRequestData . newBuilder ( ) . setUuid ( testUuid ) . 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 . getObservationUuid ( ) , is ( notNullValue ( ) ) ) ; assertThat ( dataResponse . getObservationCase ( ) , is ( ObservationCase . OBSERVATIONNATIVE ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getAssetLocation ( ) . getLatitude ( ) . getValue ( ) , is ( 74.0 ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getAssetLocation ( ) . getLongitude ( ) . getValue ( ) , is ( 54.0 ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getDetection ( ) . getTargetId ( ) , is ( "example-target-id" ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getDetection ( ) . getTargetFrequency ( ) . getValue ( ) , is ( ( double ) 30 ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getDetection ( ) . getTargetLocation ( ) . getLatitude ( ) . getValue ( ) , is ( 50.0 ) ) ; assertThat ( dataResponse . getObservationNative ( ) . getDetection ( ) . getTargetLocation ( ) . getLongitude ( ) . getValue ( ) , is ( 70.0 ) ) ; }
Verifies ability of the system to have an asset remotely capture data.
Verifies ability of the system to have an asset remotely capture data .
// build request //listen for messages for a specific time interval //ensure that observation uuid is set //ensure that observation data is set