mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendEventNamespace() throws IOException
    {
        // construct data message to send
        SendEventData sendEventData = SendEventData.newBuilder().setTopic("test").build();
        
        MessageWrapper request = 
                m_SUT.createEventAdminMessage(EventAdminMessageType.SendEvent, sendEventData);
            
        // request sending and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.EventAdmin, 1);

        // verify namespace message
        EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        
        //verify data message
        assertThat(eventAdminMessageResponse.getData(), is(sendEventData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createEventAdminMessage(EventAdminMessageType.SendEvent, null);
            
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.EventAdmin, 2);

        // verify namespace message
        eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        
        //verify data message
        assertThat(eventAdminMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected event admin contents.
     */
Verify the message wrapper returned contains the expected event admin contents.
Verify the message wrapper returned contains the expected event admin contents .
@Test
    public void testSendEventNamespace() throws IOException
    {
        SendEventData sendEventData = SendEventData.newBuilder().setTopic("test").build();
        MessageWrapper request = 
                m_SUT.createEventAdminMessage(EventAdminMessageType.SendEvent, sendEventData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.EventAdmin, 1);
        EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        assertThat(eventAdminMessageResponse.getData(), is(sendEventData.toByteString()));
        request = m_SUT.createEventAdminMessage(EventAdminMessageType.SendEvent, null);
        namespace = confirmWrapperTrySend(request, Namespace.EventAdmin, 2);
        eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        assertThat(eventAdminMessageResponse.hasData(), is(false));
    }
@ Test public void testSendEventNamespace ( ) throws IOException { SendEventData sendEventData = SendEventData . newBuilder ( ) . setTopic ( "test" ) . build ( ) ; MessageWrapper request = m_SUT . createEventAdminMessage ( EventAdminMessageType . SendEvent , sendEventData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . EventAdmin , 1 ) ; EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace . parseFrom ( namespace ) ; assertThat ( eventAdminMessageResponse . getType ( ) , is ( EventAdminMessageType . SendEvent ) ) ; assertThat ( eventAdminMessageResponse . getData ( ) , is ( sendEventData . toByteString ( ) ) ) ; request = m_SUT . createEventAdminMessage ( EventAdminMessageType . SendEvent , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . EventAdmin , 2 ) ; eventAdminMessageResponse = EventAdminNamespace . parseFrom ( namespace ) ; assertThat ( eventAdminMessageResponse . getType ( ) , is ( EventAdminMessageType . SendEvent ) ) ; assertThat ( eventAdminMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected event admin contents.
Verify the message wrapper returned contains the expected event admin 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