mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendLinkLayerNamespace() throws IOException
    {
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        
        // construct data message to send
        IsActivatedRequestData messageData = IsActivatedRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        MessageWrapper request = m_SUT.createLinkLayerMessage(LinkLayerMessageType.IsActivatedRequest, messageData);
            
        // request sending and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.LinkLayer, 1);

        // verify namespace message
        LinkLayerNamespace messageResponse = LinkLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(LinkLayerMessageType.IsActivatedRequest));

        //verify data message
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createLinkLayerMessage(LinkLayerMessageType.IsActivatedRequest, null);
            
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.LinkLayer, 2);

        // verify namespace message
        messageResponse = LinkLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(LinkLayerMessageType.IsActivatedRequest));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected link layer contents.
     */
Verify the message wrapper returned contains the expected link layer contents.
Verify the message wrapper returned contains the expected link layer contents .
@Test
    public void testSendLinkLayerNamespace() throws IOException
    {
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        IsActivatedRequestData messageData = IsActivatedRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        MessageWrapper request = m_SUT.createLinkLayerMessage(LinkLayerMessageType.IsActivatedRequest, messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.LinkLayer, 1);
        LinkLayerNamespace messageResponse = LinkLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(LinkLayerMessageType.IsActivatedRequest));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createLinkLayerMessage(LinkLayerMessageType.IsActivatedRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.LinkLayer, 2);
        messageResponse = LinkLayerNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(LinkLayerMessageType.IsActivatedRequest));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testSendLinkLayerNamespace ( ) throws IOException { java . util . UUID testUuid = java . util . UUID . randomUUID ( ) ; IsActivatedRequestData messageData = IsActivatedRequestData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; MessageWrapper request = m_SUT . createLinkLayerMessage ( LinkLayerMessageType . IsActivatedRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . LinkLayer , 1 ) ; LinkLayerNamespace messageResponse = LinkLayerNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( LinkLayerMessageType . IsActivatedRequest ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createLinkLayerMessage ( LinkLayerMessageType . IsActivatedRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . LinkLayer , 2 ) ; messageResponse = LinkLayerNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( LinkLayerMessageType . IsActivatedRequest ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected link layer contents.
Verify the message wrapper returned contains the expected link layer 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