mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueRemoteChannelLookupMessageResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData.newBuilder().
                setRemoteSystemAddress("remote").
                setRemoteSystemId(99).
                setSourceSystemAddress("dest").
                setTransportLayerName("trans-name").build();

        MessageResponseWrapper response = m_SUT.createRemoteChannelLookupResponseMessage(request, 
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, messageData);

        // request to send over mock channel and verify namespace
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.RemoteChannelLookup);
        
        // verify namespace message
        RemoteChannelLookupNamespace nameMessageResponse = 
                RemoteChannelLookupNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));

        //verify data message
        assertThat(nameMessageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createRemoteChannelLookupResponseMessage(request, 
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.RemoteChannelLookup);

        // verify namespace message
        nameMessageResponse = 
                RemoteChannelLookupNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
        
        //verify data message is not set
        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 testQueueRemoteChannelLookupMessageResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData.newBuilder().
                setRemoteSystemAddress("remote").
                setRemoteSystemId(99).
                setSourceSystemAddress("dest").
                setTransportLayerName("trans-name").build();
        MessageResponseWrapper response = m_SUT.createRemoteChannelLookupResponseMessage(request, 
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.RemoteChannelLookup);
        RemoteChannelLookupNamespace nameMessageResponse = 
                RemoteChannelLookupNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
        assertThat(nameMessageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createRemoteChannelLookupResponseMessage(request, 
                RemoteChannelLookupMessageType.SyncTransportChannelResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.RemoteChannelLookup);
        nameMessageResponse = 
                RemoteChannelLookupNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(RemoteChannelLookupMessageType.SyncTransportChannelResponse));
         is not set
        assertThat(nameMessageResponse.hasData(), is(false));
    }
@ Test public void testQueueRemoteChannelLookupMessageResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; SyncTransportChannelResponseData messageData = SyncTransportChannelResponseData . newBuilder ( ) . setRemoteSystemAddress ( "remote" ) . setRemoteSystemId ( 99 ) . setSourceSystemAddress ( "dest" ) . setTransportLayerName ( "trans-name" ) . build ( ) ; MessageResponseWrapper response = m_SUT . createRemoteChannelLookupResponseMessage ( request , RemoteChannelLookupMessageType . SyncTransportChannelResponse , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . RemoteChannelLookup ) ; RemoteChannelLookupNamespace nameMessageResponse = RemoteChannelLookupNamespace . parseFrom ( namespace ) ; assertThat ( nameMessageResponse . getType ( ) , is ( RemoteChannelLookupMessageType . SyncTransportChannelResponse ) ) ; assertThat ( nameMessageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createRemoteChannelLookupResponseMessage ( request , RemoteChannelLookupMessageType . SyncTransportChannelResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . RemoteChannelLookup ) ; nameMessageResponse = RemoteChannelLookupNamespace . parseFrom ( namespace ) ; 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 fake request message // construct data message to send // request to send over mock channel and verify namespace // verify namespace message //verify data message //--send again with no data message--// // request to send over mock channel and verify namespace // verify namespace message //verify data message is not set