mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testSendAssetDirectoryServiceNamespace() throws IOException
    {
        // construct data message to send
        GetCapabilitiesRequestData messageData = GetCapabilitiesRequestData.newBuilder().setProductType("blah blah").
                build();
        
        MessageWrapper request = m_SUT.createAssetDirectoryServiceMessage(
                AssetDirectoryServiceMessageType.GetCapabilitiesRequest, 
                messageData);
        
        // request sending, and verify namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.AssetDirectoryService, 1);

        // verify namespace message
        AssetDirectoryServiceNamespace adsMessageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(adsMessageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesRequest));

        //verify data message
        assertThat(adsMessageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createAssetDirectoryServiceMessage(AssetDirectoryServiceMessageType.GetCapabilitiesRequest, 
                null);
        
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.AssetDirectoryService, 2);

        // verify namespace message
        adsMessageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(adsMessageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesRequest));
        
        //verify data message
        assertThat(adsMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected asset directory service contents.
     */
Verify the message wrapper returned contains the expected asset directory service contents.
Verify the message wrapper returned contains the expected asset directory service contents .
@Test
    public void testSendAssetDirectoryServiceNamespace() throws IOException
    {
        GetCapabilitiesRequestData messageData = GetCapabilitiesRequestData.newBuilder().setProductType("blah blah").
                build();
        MessageWrapper request = m_SUT.createAssetDirectoryServiceMessage(
                AssetDirectoryServiceMessageType.GetCapabilitiesRequest, 
                messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.AssetDirectoryService, 1);
        AssetDirectoryServiceNamespace adsMessageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(adsMessageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesRequest));
        assertThat(adsMessageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createAssetDirectoryServiceMessage(AssetDirectoryServiceMessageType.GetCapabilitiesRequest, 
                null);
        namespace = confirmWrapperTrySend(request, Namespace.AssetDirectoryService, 2);
        adsMessageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(adsMessageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesRequest));
        assertThat(adsMessageResponse.hasData(), is(false));
    }
@ Test public void testSendAssetDirectoryServiceNamespace ( ) throws IOException { GetCapabilitiesRequestData messageData = GetCapabilitiesRequestData . newBuilder ( ) . setProductType ( "blah blah" ) . build ( ) ; MessageWrapper request = m_SUT . createAssetDirectoryServiceMessage ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . AssetDirectoryService , 1 ) ; AssetDirectoryServiceNamespace adsMessageResponse = AssetDirectoryServiceNamespace . parseFrom ( namespace ) ; assertThat ( adsMessageResponse . getType ( ) , is ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest ) ) ; assertThat ( adsMessageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createAssetDirectoryServiceMessage ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . AssetDirectoryService , 2 ) ; adsMessageResponse = AssetDirectoryServiceNamespace . parseFrom ( namespace ) ; assertThat ( adsMessageResponse . getType ( ) , is ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest ) ) ; assertThat ( adsMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected asset directory service contents.
Verify the message wrapper returned contains the expected asset directory service 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