mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestTransportLayerNamespace.java
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
    
        GetCapabilitiesRequestData transportLayerCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.TransportLayer).setProductType(EchoTransport.class.getName()).build();
    
        TerraHarvestMessage message = 
                createTransportLayerMessage(CustomCommsMessageType.GetCapabilitiesRequest, transportLayerCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        Message responseRcvd = listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1000);
        CustomCommsNamespace response = (CustomCommsNamespace)responseRcvd;
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
    
        //test various capabilities
        assertThat(dataResponse.getTransportCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getTransportCapabilities().getBase().getDescription(), 
                is("An example transport layer that echoes messages back through the same transport layer"));
        assertThat(dataResponse.getTransportCapabilities().getBase().getManufacturer(), is("ExampleManufacturer"));
        assertThat(dataResponse.getTransportCapabilities().getBase().getProductName(), is("Echo Transport"));
    }
/**
     * Verifies the ability of the system to get a transport layer's capabilities remotely.
     */
Verifies the ability of the system to get a transport layer's capabilities remotely.
Verifies the ability of the system to get a transport layer ' s capabilities remotely .
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        GetCapabilitiesRequestData transportLayerCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.TransportLayer).setProductType(EchoTransport.class.getName()).build();
        TerraHarvestMessage message = 
                createTransportLayerMessage(CustomCommsMessageType.GetCapabilitiesRequest, transportLayerCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        Message responseRcvd = listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1000);
        CustomCommsNamespace response = (CustomCommsNamespace)responseRcvd;
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getTransportCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getTransportCapabilities().getBase().getDescription(), 
                is("An example transport layer that echoes messages back through the same transport layer"));
        assertThat(dataResponse.getTransportCapabilities().getBase().getManufacturer(), is("ExampleManufacturer"));
        assertThat(dataResponse.getTransportCapabilities().getBase().getProductName(), is("Echo Transport"));
    }
@ Test public final void testGetCapabilities ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; GetCapabilitiesRequestData transportLayerCapsRequest = GetCapabilitiesRequestData . newBuilder ( ) . setCommType ( CommType . TransportLayer ) . setProductType ( EchoTransport . class . getName ( ) ) . build ( ) ; TerraHarvestMessage message = createTransportLayerMessage ( CustomCommsMessageType . GetCapabilitiesRequest , transportLayerCapsRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message responseRcvd = listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . GetCapabilitiesResponse , 1000 ) ; CustomCommsNamespace response = ( CustomCommsNamespace ) responseRcvd ; GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getTransportCapabilities ( ) , is ( notNullValue ( ) ) ) ; assertThat ( dataResponse . getTransportCapabilities ( ) . getBase ( ) . getDescription ( ) , is ( "An example transport layer that echoes messages back through the same transport layer" ) ) ; assertThat ( dataResponse . getTransportCapabilities ( ) . getBase ( ) . getManufacturer ( ) , is ( "ExampleManufacturer" ) ) ; assertThat ( dataResponse . getTransportCapabilities ( ) . getBase ( ) . getProductName ( ) , is ( "Echo Transport" ) ) ; }
Verifies the ability of the system to get a transport layer's capabilities remotely.
Verifies the ability of the system to get a transport layer ' s capabilities remotely .
//listen for messages for a specific time interval //test various capabilities