mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendBaseMessage() throws IOException
    {
        // construct data message to send
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        
        MessageWrapper request = m_SUT.createBaseMessage(BaseMessageType.ControllerInfo, systemInfoData);
        
        //request to send and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.Base, 1);
        
        // verify namespace message
        BaseNamespace baseMessageResponse = BaseNamespace.parseFrom(namespace);
        assertThat(baseMessageResponse.getType(), is(BaseMessageType.ControllerInfo));
        
        //verify data message
        assertThat(baseMessageResponse.getData(), is(systemInfoData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createBaseMessage(BaseMessageType.ControllerInfo, null);
        
        //request to send and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.Base, 2);
        
        // verify namespace message
        baseMessageResponse = BaseNamespace.parseFrom(namespace);
        assertThat(baseMessageResponse.getType(), is(BaseMessageType.ControllerInfo));
        
        //verify data message
        assertThat(baseMessageResponse.hasData(), is(false));
    }
/**
     *  Verify the message wrapper returned contains the expected base message contents.
     */
Verify the message wrapper returned contains the expected base message contents.
Verify the message wrapper returned contains the expected base message contents .
@Test
    public void testSendBaseMessage() throws IOException
    {
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        MessageWrapper request = m_SUT.createBaseMessage(BaseMessageType.ControllerInfo, systemInfoData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.Base, 1);
        BaseNamespace baseMessageResponse = BaseNamespace.parseFrom(namespace);
        assertThat(baseMessageResponse.getType(), is(BaseMessageType.ControllerInfo));
        assertThat(baseMessageResponse.getData(), is(systemInfoData.toByteString()));
        request = m_SUT.createBaseMessage(BaseMessageType.ControllerInfo, null);
        namespace = confirmWrapperTrySend(request, Namespace.Base, 2);
        baseMessageResponse = BaseNamespace.parseFrom(namespace);
        assertThat(baseMessageResponse.getType(), is(BaseMessageType.ControllerInfo));
        assertThat(baseMessageResponse.hasData(), is(false));
    }
@ Test public void testSendBaseMessage ( ) throws IOException { ControllerInfoData systemInfoData = ControllerInfoData . newBuilder ( ) . setName ( "blah" ) . build ( ) ; MessageWrapper request = m_SUT . createBaseMessage ( BaseMessageType . ControllerInfo , systemInfoData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . Base , 1 ) ; BaseNamespace baseMessageResponse = BaseNamespace . parseFrom ( namespace ) ; assertThat ( baseMessageResponse . getType ( ) , is ( BaseMessageType . ControllerInfo ) ) ; assertThat ( baseMessageResponse . getData ( ) , is ( systemInfoData . toByteString ( ) ) ) ; request = m_SUT . createBaseMessage ( BaseMessageType . ControllerInfo , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . Base , 2 ) ; baseMessageResponse = BaseNamespace . parseFrom ( namespace ) ; assertThat ( baseMessageResponse . getType ( ) , is ( BaseMessageType . ControllerInfo ) ) ; assertThat ( baseMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected base message contents.
Verify the message wrapper returned contains the expected base message contents .
// construct data message to send //request to send and verify namespace // verify namespace message //verify data message //--send again with null for the data message--// //request to send and verify namespace // verify namespace message //verify data message