mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestAssetDirectoryServiceNamespace.java
@Test
    public final void testGetCapabilities() throws Exception
    {
        MessageListener listener = new MessageListener(socket);
        
        GetCapabilitiesRequestData request = GetCapabilitiesRequestData.newBuilder().
                setProductType(ExampleAsset.class.getName()).build();        
        
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.GetCapabilitiesRequest, request);         
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        Message responseRcvd = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.GetCapabilitiesResponse, 1200);  
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)responseRcvd;
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
        
        //test various capabilities
        assertThat(dataResponse.getCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getColorAvailable(), is(false));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getMinResolution().getHeight(),
                is(0));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getFramesPerSecondCount(), is(1));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getAvailableCameraIDsCount(), is(1));
        
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getCaptureData(), is(true));
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getPerformBIT(), is(true));
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getPanTilt().getMaxAzimuth().getValue(), 
                is(50.0));
        
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getRecordersCount(), is(1));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getRecorders(0).getDescription(), is("none"));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getSampleRatesKHzCount(), is(1));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getSampleRatesKHz(0), is((float)14.4));
        
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getDirectionOfTravel(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetFrequency(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetId(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetLOB(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetLocation(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetOrientation(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetRange(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetSpeed(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTrackHistory(), is(true)); 
    }
/**
     * Verifies ability of the system to get an asset's capabilities remotely. 
     */
Verifies ability of the system to get an asset's capabilities remotely.
Verifies ability of the system to get an asset ' s capabilities remotely .
@Test
    public final void testGetCapabilities() throws Exception
    {
        MessageListener listener = new MessageListener(socket);
        GetCapabilitiesRequestData request = GetCapabilitiesRequestData.newBuilder().
                setProductType(ExampleAsset.class.getName()).build();        
        TerraHarvestMessage message = AssetNamespaceUtils.createAssetDirSvcNamespaceMessage(
                AssetDirectoryServiceMessageType.GetCapabilitiesRequest, request);         
        message.writeDelimitedTo(socket.getOutputStream());
        Message responseRcvd = listener.waitForMessage(Namespace.AssetDirectoryService, 
                AssetDirectoryServiceMessageType.GetCapabilitiesResponse, 1200);  
        AssetDirectoryServiceNamespace response = (AssetDirectoryServiceNamespace)responseRcvd;
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getColorAvailable(), is(false));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getMinResolution().getHeight(),
                is(0));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getFramesPerSecondCount(), is(1));
        assertThat(dataResponse.getCapabilities().getVideoCapabilities().getBase().getAvailableCameraIDsCount(), is(1));
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getCaptureData(), is(true));
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getPerformBIT(), is(true));
        assertThat(dataResponse.getCapabilities().getCommandCapabilities().getPanTilt().getMaxAzimuth().getValue(), 
                is(50.0));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getRecordersCount(), is(1));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getRecorders(0).getDescription(), is("none"));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getSampleRatesKHzCount(), is(1));
        assertThat(dataResponse.getCapabilities().getAudioCapabilities().getSampleRatesKHz(0), is((float)14.4));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getDirectionOfTravel(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetFrequency(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetId(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetLOB(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetLocation(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetOrientation(), is(true));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetRange(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTargetSpeed(), is(false));
        assertThat(dataResponse.getCapabilities().getDetectionCapabilities().getTrackHistory(), is(true)); 
    }
@ Test public final void testGetCapabilities ( ) throws Exception { MessageListener listener = new MessageListener ( socket ) ; GetCapabilitiesRequestData request = GetCapabilitiesRequestData . newBuilder ( ) . setProductType ( ExampleAsset . class . getName ( ) ) . build ( ) ; TerraHarvestMessage message = AssetNamespaceUtils . createAssetDirSvcNamespaceMessage ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest , request ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message responseRcvd = listener . waitForMessage ( Namespace . AssetDirectoryService , AssetDirectoryServiceMessageType . GetCapabilitiesResponse , 1200 ) ; AssetDirectoryServiceNamespace response = ( AssetDirectoryServiceNamespace ) responseRcvd ; GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getCapabilities ( ) , is ( notNullValue ( ) ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getVideoCapabilities ( ) . getBase ( ) . getColorAvailable ( ) , is ( false ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getVideoCapabilities ( ) . getBase ( ) . getMinResolution ( ) . getHeight ( ) , is ( 0 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getVideoCapabilities ( ) . getFramesPerSecondCount ( ) , is ( 1 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getVideoCapabilities ( ) . getBase ( ) . getAvailableCameraIDsCount ( ) , is ( 1 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getCommandCapabilities ( ) . getCaptureData ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getCommandCapabilities ( ) . getPerformBIT ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getCommandCapabilities ( ) . getPanTilt ( ) . getMaxAzimuth ( ) . getValue ( ) , is ( 50.0 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getAudioCapabilities ( ) . getRecordersCount ( ) , is ( 1 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getAudioCapabilities ( ) . getRecorders ( 0 ) . getDescription ( ) , is ( "none" ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getAudioCapabilities ( ) . getSampleRatesKHzCount ( ) , is ( 1 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getAudioCapabilities ( ) . getSampleRatesKHz ( 0 ) , is ( ( float ) 14.4 ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getDirectionOfTravel ( ) , is ( false ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetFrequency ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetId ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetLOB ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetLocation ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetOrientation ( ) , is ( true ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetRange ( ) , is ( false ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTargetSpeed ( ) , is ( false ) ) ; assertThat ( dataResponse . getCapabilities ( ) . getDetectionCapabilities ( ) . getTrackHistory ( ) , is ( true ) ) ; }
Verifies ability of the system to get an asset's capabilities remotely.
Verifies ability of the system to get an asset ' s capabilities remotely .
//listen for messages for a specific time interval //test various capabilities