mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendCustomCommsServiceNamespace() throws IOException
    {
        // construct data message to send
        CreatePhysicalLinkRequestData messageData = CreatePhysicalLinkRequestData.newBuilder()
                .setPhysicalLinkType(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT)
                .setPhysicalLinkName("space")
                .build();
        
        MessageWrapper request = 
                m_SUT.createCustomCommsMessage(CustomCommsMessageType.CreatePhysicalLinkRequest, messageData);
            
        // request sending and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.CustomComms, 1);

        // verify namespace message
        CustomCommsNamespace messageResponse = CustomCommsNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(CustomCommsMessageType.CreatePhysicalLinkRequest));

        //verify data message
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createCustomCommsMessage(CustomCommsMessageType.CreatePhysicalLinkRequest, null);
            
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.CustomComms, 2);

        // verify namespace message
        messageResponse = CustomCommsNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(CustomCommsMessageType.CreatePhysicalLinkRequest));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected custom comms contents.
     */
Verify the message wrapper returned contains the expected custom comms contents.
Verify the message wrapper returned contains the expected custom comms contents .
@Test
    public void testSendCustomCommsServiceNamespace() throws IOException
    {
        CreatePhysicalLinkRequestData messageData = CreatePhysicalLinkRequestData.newBuilder()
                .setPhysicalLinkType(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT)
                .setPhysicalLinkName("space")
                .build();
        MessageWrapper request = 
                m_SUT.createCustomCommsMessage(CustomCommsMessageType.CreatePhysicalLinkRequest, messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.CustomComms, 1);
        CustomCommsNamespace messageResponse = CustomCommsNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(CustomCommsMessageType.CreatePhysicalLinkRequest));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createCustomCommsMessage(CustomCommsMessageType.CreatePhysicalLinkRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.CustomComms, 2);
        messageResponse = CustomCommsNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(CustomCommsMessageType.CreatePhysicalLinkRequest));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testSendCustomCommsServiceNamespace ( ) throws IOException { CreatePhysicalLinkRequestData messageData = CreatePhysicalLinkRequestData . newBuilder ( ) . setPhysicalLinkType ( CustomCommTypesGen . PhysicalLinkType . Enum . SERIAL_PORT ) . setPhysicalLinkName ( "space" ) . build ( ) ; MessageWrapper request = m_SUT . createCustomCommsMessage ( CustomCommsMessageType . CreatePhysicalLinkRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . CustomComms , 1 ) ; CustomCommsNamespace messageResponse = CustomCommsNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( CustomCommsMessageType . CreatePhysicalLinkRequest ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createCustomCommsMessage ( CustomCommsMessageType . CreatePhysicalLinkRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . CustomComms , 2 ) ; messageResponse = CustomCommsNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( CustomCommsMessageType . CreatePhysicalLinkRequest ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected custom comms contents.
Verify the message wrapper returned contains the expected custom comms 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