mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendBundleMessage() throws IOException
    {
        // construct data message to send
        StartRequestData messageData = StartRequestData.newBuilder().setBundleId(1L).build();
        
        MessageWrapper request = m_SUT.createBundleMessage(BundleMessageType.StartRequest, messageData);
        
        // request sending
        ByteString namespace = confirmWrapperTrySend(request, Namespace.Bundle, 1);

        // verify namespace message
        BundleNamespace bunRequest = BundleNamespace.parseFrom(namespace);
        assertThat(bunRequest.getType(), is(BundleMessageType.StartRequest));

        //verify data message
        assertThat(bunRequest.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createBundleMessage(BundleMessageType.StartRequest, null);
        
        // request sending
        namespace = confirmWrapperTrySend(request, Namespace.Bundle, 2);

        // verify namespace message
        bunRequest = BundleNamespace.parseFrom(namespace);
        assertThat(bunRequest.getType(), is(BundleMessageType.StartRequest));
        
        //verify data message
        assertThat(bunRequest.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected bundle contents.
     */
Verify the message wrapper returned contains the expected bundle contents.
Verify the message wrapper returned contains the expected bundle contents .
@Test
    public void testSendBundleMessage() throws IOException
    {
        StartRequestData messageData = StartRequestData.newBuilder().setBundleId(1L).build();
        MessageWrapper request = m_SUT.createBundleMessage(BundleMessageType.StartRequest, messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.Bundle, 1);
        BundleNamespace bunRequest = BundleNamespace.parseFrom(namespace);
        assertThat(bunRequest.getType(), is(BundleMessageType.StartRequest));
        assertThat(bunRequest.getData(), is(messageData.toByteString()));
        request = m_SUT.createBundleMessage(BundleMessageType.StartRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.Bundle, 2);
        bunRequest = BundleNamespace.parseFrom(namespace);
        assertThat(bunRequest.getType(), is(BundleMessageType.StartRequest));
        assertThat(bunRequest.hasData(), is(false));
    }
@ Test public void testSendBundleMessage ( ) throws IOException { StartRequestData messageData = StartRequestData . newBuilder ( ) . setBundleId ( 1L ) . build ( ) ; MessageWrapper request = m_SUT . createBundleMessage ( BundleMessageType . StartRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . Bundle , 1 ) ; BundleNamespace bunRequest = BundleNamespace . parseFrom ( namespace ) ; assertThat ( bunRequest . getType ( ) , is ( BundleMessageType . StartRequest ) ) ; assertThat ( bunRequest . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createBundleMessage ( BundleMessageType . StartRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . Bundle , 2 ) ; bunRequest = BundleNamespace . parseFrom ( namespace ) ; assertThat ( bunRequest . getType ( ) , is ( BundleMessageType . StartRequest ) ) ; assertThat ( bunRequest . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected bundle contents.
Verify the message wrapper returned contains the expected bundle contents .
// construct data message to send // request sending // verify namespace message //verify data message //--send again with null for the data message--// // request sending // verify namespace message //verify data message