mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendMetatypeNamespace() throws IOException
    {
        // construct data message to send
        GetAttributeDefinitionRequestData getAttrDefData = 
                GetAttributeDefinitionRequestData.newBuilder().setBundleId(1).setPid("test-pid").build();
        
        MessageWrapper request = 
                m_SUT.createMetaTypeMessage(MetaTypeMessageType.GetAttributeDefinitionRequest, getAttrDefData);
            
        // request sending and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.MetaType, 1);

        // verify namespace message
        MetaTypeNamespace metaTypeMessageResponse = MetaTypeNamespace.parseFrom(namespace);
        assertThat(metaTypeMessageResponse.getType(), is(MetaTypeMessageType.GetAttributeDefinitionRequest));
        
        //verify data message
        assertThat(metaTypeMessageResponse.getData(), is(getAttrDefData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createMetaTypeMessage(MetaTypeMessageType.GetAttributeDefinitionRequest, null);
            
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.MetaType, 2);

        // verify namespace message
        metaTypeMessageResponse = MetaTypeNamespace.parseFrom(namespace);
        assertThat(metaTypeMessageResponse.getType(), is(MetaTypeMessageType.GetAttributeDefinitionRequest));
        
        //verify data message
        assertThat(metaTypeMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected metatype contents.
     */
Verify the message wrapper returned contains the expected metatype contents.
Verify the message wrapper returned contains the expected metatype contents .
@Test
    public void testSendMetatypeNamespace() throws IOException
    {
        GetAttributeDefinitionRequestData getAttrDefData = 
                GetAttributeDefinitionRequestData.newBuilder().setBundleId(1).setPid("test-pid").build();
        MessageWrapper request = 
                m_SUT.createMetaTypeMessage(MetaTypeMessageType.GetAttributeDefinitionRequest, getAttrDefData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.MetaType, 1);
        MetaTypeNamespace metaTypeMessageResponse = MetaTypeNamespace.parseFrom(namespace);
        assertThat(metaTypeMessageResponse.getType(), is(MetaTypeMessageType.GetAttributeDefinitionRequest));
        assertThat(metaTypeMessageResponse.getData(), is(getAttrDefData.toByteString()));
        request = m_SUT.createMetaTypeMessage(MetaTypeMessageType.GetAttributeDefinitionRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.MetaType, 2);
        metaTypeMessageResponse = MetaTypeNamespace.parseFrom(namespace);
        assertThat(metaTypeMessageResponse.getType(), is(MetaTypeMessageType.GetAttributeDefinitionRequest));
        assertThat(metaTypeMessageResponse.hasData(), is(false));
    }
@ Test public void testSendMetatypeNamespace ( ) throws IOException { GetAttributeDefinitionRequestData getAttrDefData = GetAttributeDefinitionRequestData . newBuilder ( ) . setBundleId ( 1 ) . setPid ( "test-pid" ) . build ( ) ; MessageWrapper request = m_SUT . createMetaTypeMessage ( MetaTypeMessageType . GetAttributeDefinitionRequest , getAttrDefData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . MetaType , 1 ) ; MetaTypeNamespace metaTypeMessageResponse = MetaTypeNamespace . parseFrom ( namespace ) ; assertThat ( metaTypeMessageResponse . getType ( ) , is ( MetaTypeMessageType . GetAttributeDefinitionRequest ) ) ; assertThat ( metaTypeMessageResponse . getData ( ) , is ( getAttrDefData . toByteString ( ) ) ) ; request = m_SUT . createMetaTypeMessage ( MetaTypeMessageType . GetAttributeDefinitionRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . MetaType , 2 ) ; metaTypeMessageResponse = MetaTypeNamespace . parseFrom ( namespace ) ; assertThat ( metaTypeMessageResponse . getType ( ) , is ( MetaTypeMessageType . GetAttributeDefinitionRequest ) ) ; assertThat ( metaTypeMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected metatype contents.
Verify the message wrapper returned contains the expected metatype 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