mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendTransportLayerNamespace() throws IOException
    {
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        
        // construct data message to send
        IsReceivingRequestData messageData = IsReceivingRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        MessageWrapper request = m_SUT.createTransportLayerMessage(TransportLayerMessageType.IsReceivingRequest, 
                messageData);
        
        // request sending
        ByteString namespace = confirmWrapperTrySend(request, Namespace.TransportLayer, 1);

        // verify namespace message
        TransportLayerNamespace messageResponse = 
                TransportLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(TransportLayerMessageType.IsReceivingRequest));

        //verify data message
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createTransportLayerMessage(TransportLayerMessageType.IsReceivingRequest, null);
        
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.TransportLayer, 2);

        // verify namespace message
        messageResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(TransportLayerMessageType.IsReceivingRequest));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected transport layer contents.
     */
Verify the message wrapper returned contains the expected transport layer contents.
Verify the message wrapper returned contains the expected transport layer contents .
@Test
    public void testSendTransportLayerNamespace() throws IOException
    {
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        IsReceivingRequestData messageData = IsReceivingRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        MessageWrapper request = m_SUT.createTransportLayerMessage(TransportLayerMessageType.IsReceivingRequest, 
                messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.TransportLayer, 1);
        TransportLayerNamespace messageResponse = 
                TransportLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(TransportLayerMessageType.IsReceivingRequest));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createTransportLayerMessage(TransportLayerMessageType.IsReceivingRequest, null);
         and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.TransportLayer, 2);
        messageResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(TransportLayerMessageType.IsReceivingRequest));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testSendTransportLayerNamespace ( ) throws IOException { java . util . UUID testUuid = java . util . UUID . randomUUID ( ) ; IsReceivingRequestData messageData = IsReceivingRequestData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; MessageWrapper request = m_SUT . createTransportLayerMessage ( TransportLayerMessageType . IsReceivingRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . TransportLayer , 1 ) ; TransportLayerNamespace messageResponse = TransportLayerNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( TransportLayerMessageType . IsReceivingRequest ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createTransportLayerMessage ( TransportLayerMessageType . IsReceivingRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . TransportLayer , 2 ) ; messageResponse = TransportLayerNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( TransportLayerMessageType . IsReceivingRequest ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected transport layer contents.
Verify the message wrapper returned contains the expected transport layer contents .
// construct data message to send // request sending // verify namespace message //verify data message //--send again with null for the data message--// // request sending and verify namespace // verify namespace message //verify data message