mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendRemoteChannelLookupMessage() throws IOException
    {
        // construct data message to send
        SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData.newBuilder().
                setRemoteSystemAddress("remote").
                setRemoteSystemId(99).
                setSourceSystemAddress("dest").
                setTransportLayerName("trans-name").build();
        
        MessageWrapper request = m_SUT.createRemoteChannelLookupMessage(
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, messageData);
        
        // request sending, and verify namespace
        ByteString namespaceMessage = confirmWrapperTrySend(request, Namespace.RemoteChannelLookup, 1);
        
        // verify namespace message
        RemoteChannelLookupNamespace nameMessageResponse = RemoteChannelLookupNamespace.parseFrom(namespaceMessage);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));

        //verify data message
        assertThat(nameMessageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createRemoteChannelLookupMessage(RemoteChannelLookupMessageType.SyncTransportChannelResponse, 
                null);
        
        // request sending and verify namespace
        namespaceMessage = confirmWrapperTrySend(request, Namespace.RemoteChannelLookup, 2);

        // verify namespace message
        nameMessageResponse = RemoteChannelLookupNamespace.parseFrom(namespaceMessage);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
        
        //verify data message
        assertThat(nameMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected remote channel lookup contents.
     */
Verify the message wrapper returned contains the expected remote channel lookup contents.
Verify the message wrapper returned contains the expected remote channel lookup contents .
@Test
    public void testSendRemoteChannelLookupMessage() throws IOException
    {
        SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData.newBuilder().
                setRemoteSystemAddress("remote").
                setRemoteSystemId(99).
                setSourceSystemAddress("dest").
                setTransportLayerName("trans-name").build();
        MessageWrapper request = m_SUT.createRemoteChannelLookupMessage(
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, messageData);
        ByteString namespaceMessage = confirmWrapperTrySend(request, Namespace.RemoteChannelLookup, 1);
        RemoteChannelLookupNamespace nameMessageResponse = RemoteChannelLookupNamespace.parseFrom(namespaceMessage);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
        assertThat(nameMessageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createRemoteChannelLookupMessage(RemoteChannelLookupMessageType.SyncTransportChannelResponse, 
                null);
        namespaceMessage = confirmWrapperTrySend(request, Namespace.RemoteChannelLookup, 2);
        nameMessageResponse = RemoteChannelLookupNamespace.parseFrom(namespaceMessage);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
        assertThat(nameMessageResponse.hasData(), is(false));
    }
@ Test public void testSendRemoteChannelLookupMessage ( ) throws IOException { SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData . newBuilder ( ) . setRemoteSystemAddress ( "remote" ) . setRemoteSystemId ( 99 ) . setSourceSystemAddress ( "dest" ) . setTransportLayerName ( "trans-name" ) . build ( ) ; MessageWrapper request = m_SUT . createRemoteChannelLookupMessage ( RemoteChannelLookupMessageType . SyncTransportChannelResponse , messageData ) ; ByteString namespaceMessage = confirmWrapperTrySend ( request , Namespace . RemoteChannelLookup , 1 ) ; RemoteChannelLookupNamespace nameMessageResponse = RemoteChannelLookupNamespace . parseFrom ( namespaceMessage ) ; assertThat ( nameMessageResponse . getType ( ) , is ( RemoteChannelLookupMessageType . SyncTransportChannelResponse ) ) ; assertThat ( nameMessageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createRemoteChannelLookupMessage ( RemoteChannelLookupMessageType . SyncTransportChannelResponse , null ) ; namespaceMessage = confirmWrapperTrySend ( request , Namespace . RemoteChannelLookup , 2 ) ; nameMessageResponse = RemoteChannelLookupNamespace . parseFrom ( namespaceMessage ) ; assertThat ( nameMessageResponse . getType ( ) , is ( RemoteChannelLookupMessageType . SyncTransportChannelResponse ) ) ; assertThat ( nameMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected remote channel lookup contents.
Verify the message wrapper returned contains the expected remote channel lookup contents .
// construct data message to send // request sending, and verify namespace // 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