mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendMissionNamespace() throws IOException
    {
        // construct data message to send
        MissionProgramTemplate template = MissionProgramTemplate.newBuilder().setName("test").setSource("src").build();
        GetTemplatesResponseData getTemplateData = GetTemplatesResponseData.newBuilder().addTemplate(template).build();
        
        MessageWrapper request = 
            m_SUT.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest, getTemplateData);
        
        //request sending and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.MissionProgramming, 1);
        
        // verify namespace message
        MissionProgrammingNamespace mpMessageResponse = 
                MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(mpMessageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesRequest));
        
        //verify data in the message
        GetTemplatesResponseData mpDataResponse = GetTemplatesResponseData.parseFrom(mpMessageResponse.getData());
        MissionProgramTemplate mpTemplateData = mpDataResponse.getTemplate(0);
        assertThat(mpTemplateData, is(template));
        
        //--send again with null for the data message--//
        request = m_SUT.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest, null);

        // request sending
        namespace = confirmWrapperTrySend(request, Namespace.MissionProgramming, 2);
       
        // verify namespace message
        mpMessageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(mpMessageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesRequest));
        
        assertThat(mpMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected mission programming contents.
     */
Verify the message wrapper returned contains the expected mission programming contents.
Verify the message wrapper returned contains the expected mission programming contents .
@Test
    public void testSendMissionNamespace() throws IOException
    {
        MissionProgramTemplate template = MissionProgramTemplate.newBuilder().setName("test").setSource("src").build();
        GetTemplatesResponseData getTemplateData = GetTemplatesResponseData.newBuilder().addTemplate(template).build();
        MessageWrapper request = 
            m_SUT.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest, getTemplateData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.MissionProgramming, 1);
        MissionProgrammingNamespace mpMessageResponse = 
                MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(mpMessageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesRequest));
        GetTemplatesResponseData mpDataResponse = GetTemplatesResponseData.parseFrom(mpMessageResponse.getData());
        MissionProgramTemplate mpTemplateData = mpDataResponse.getTemplate(0);
        assertThat(mpTemplateData, is(template));
        request = m_SUT.createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.MissionProgramming, 2);
        mpMessageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(mpMessageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesRequest));
        assertThat(mpMessageResponse.hasData(), is(false));
    }
@ Test public void testSendMissionNamespace ( ) throws IOException { MissionProgramTemplate template = MissionProgramTemplate . newBuilder ( ) . setName ( "test" ) . setSource ( "src" ) . build ( ) ; GetTemplatesResponseData getTemplateData = GetTemplatesResponseData . newBuilder ( ) . addTemplate ( template ) . build ( ) ; MessageWrapper request = m_SUT . createMissionProgrammingMessage ( MissionProgrammingMessageType . GetTemplatesRequest , getTemplateData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . MissionProgramming , 1 ) ; MissionProgrammingNamespace mpMessageResponse = MissionProgrammingNamespace . parseFrom ( namespace ) ; assertThat ( mpMessageResponse . getType ( ) , is ( MissionProgrammingMessageType . GetTemplatesRequest ) ) ; GetTemplatesResponseData mpDataResponse = GetTemplatesResponseData . parseFrom ( mpMessageResponse . getData ( ) ) ; MissionProgramTemplate mpTemplateData = mpDataResponse . getTemplate ( 0 ) ; assertThat ( mpTemplateData , is ( template ) ) ; request = m_SUT . createMissionProgrammingMessage ( MissionProgrammingMessageType . GetTemplatesRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . MissionProgramming , 2 ) ; mpMessageResponse = MissionProgrammingNamespace . parseFrom ( namespace ) ; assertThat ( mpMessageResponse . getType ( ) , is ( MissionProgrammingMessageType . GetTemplatesRequest ) ) ; assertThat ( mpMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected mission programming contents.
Verify the message wrapper returned contains the expected mission programming contents .
// construct data message to send //request sending and verify namespace // verify namespace message //verify data in the message //--send again with null for the data message--// // request sending // verify namespace message