mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestTransportLayerNamespace.java
@Test
    public void testIsAvailable() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        IsAvailableRequestData isReceivingRequest = IsAvailableRequestData.newBuilder().
                setUuid(transportUuid).
                setAddress("Example:5").
                build();
        
        TransportLayerNamespace.Builder transportLayerMessage = TransportLayerNamespace.newBuilder().
                setType(TransportLayerMessageType.IsAvailableRequest).
                setData(isReceivingRequest.toByteString());
        
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.TransportLayer, 
                transportLayerMessage);
        
        // send out message
        message.writeDelimitedTo(socket.getOutputStream());
        
        // listen for messages for a specific time interval
        Message responseRcvd = listener.waitForMessage(Namespace.TransportLayer,
                TransportLayerMessageType.IsAvailableResponse, listenerTimeout);

        TransportLayerNamespace response = (TransportLayerNamespace)responseRcvd;
        
        IsAvailableResponseData dataResponse = IsAvailableResponseData.parseFrom(
                response.getData());
        
        assertThat(dataResponse.getIsAvailable(), is(true));
        assertThat(dataResponse.getUuid(), is(transportUuid));
    }
/**
     * Assuming that a transport was created in setup, echo transport will always return true for any address,
     * verify that true is returned.
     */
Assuming that a transport was created in setup, echo transport will always return true for any address,
verify that true is returned.
Assuming that a transport was created in setup echo transport will always return true for any address verify that true is returned .
@Test
    public void testIsAvailable() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        IsAvailableRequestData isReceivingRequest = IsAvailableRequestData.newBuilder().
                setUuid(transportUuid).
                setAddress("Example:5").
                build();
        TransportLayerNamespace.Builder transportLayerMessage = TransportLayerNamespace.newBuilder().
                setType(TransportLayerMessageType.IsAvailableRequest).
                setData(isReceivingRequest.toByteString());
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.TransportLayer, 
                transportLayerMessage);
        message.writeDelimitedTo(socket.getOutputStream());
        Message responseRcvd = listener.waitForMessage(Namespace.TransportLayer,
                TransportLayerMessageType.IsAvailableResponse, listenerTimeout);
        TransportLayerNamespace response = (TransportLayerNamespace)responseRcvd;
        IsAvailableResponseData dataResponse = IsAvailableResponseData.parseFrom(
                response.getData());
        assertThat(dataResponse.getIsAvailable(), is(true));
        assertThat(dataResponse.getUuid(), is(transportUuid));
    }
@ Test public void testIsAvailable ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; IsAvailableRequestData isReceivingRequest = IsAvailableRequestData . newBuilder ( ) . setUuid ( transportUuid ) . setAddress ( "Example:5" ) . build ( ) ; TransportLayerNamespace . Builder transportLayerMessage = TransportLayerNamespace . newBuilder ( ) . setType ( TransportLayerMessageType . IsAvailableRequest ) . setData ( isReceivingRequest . toByteString ( ) ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . TransportLayer , transportLayerMessage ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; Message responseRcvd = listener . waitForMessage ( Namespace . TransportLayer , TransportLayerMessageType . IsAvailableResponse , listenerTimeout ) ; TransportLayerNamespace response = ( TransportLayerNamespace ) responseRcvd ; IsAvailableResponseData dataResponse = IsAvailableResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getIsAvailable ( ) , is ( true ) ) ; assertThat ( dataResponse . getUuid ( ) , is ( transportUuid ) ) ; }
Assuming that a transport was created in setup, echo transport will always return true for any address,
 verify that true is returned.
Assuming that a transport was created in setup echo transport will always return true for any address verify that true is returned .
// send out message // listen for messages for a specific time interval