mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestCustomCommsMessageService.java
@Test
    public final void testGetTransportLayerCapabilitiesResponse() throws IOException
    {
        Message capsGen = TransportLayerCapabilitiesGen.TransportLayerCapabilities.newBuilder().
                setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder().
                    setManufacturer("TransportCaps Response Makers").
                    setDescription("A responsive transport layer.").
                    setProductName("CapsResponseTransportLayer")).
                build();
        Message response = GetCapabilitiesResponseData.newBuilder().
                setTransportCapabilities((TransportLayerCapabilitiesGen.TransportLayerCapabilities) capsGen).
                setCommType(CommType.TransportLayer).
                setProductType(TransportLayer.class.getName()).build();
        CustomCommsNamespace transportLayerMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.GetCapabilitiesResponse).
                setData(response.toByteString()).build();
        TerraHarvestPayload payload = createPayload(transportLayerMessage);
        TerraHarvestMessage message = createCustomCommsMessage(transportLayerMessage);
        
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        
        //verify event is posted
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event postedEvent = eventCaptor.getValue();
        assertThat((Message)postedEvent.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE), is(response));
    }
/**
     * Verify get capabilities response message will set the data event property correctly when handled
     * for transport layers.
     */
Verify get capabilities response message will set the data event property correctly when handled
for transport layers.
Verify get capabilities response message will set the data event property correctly when handled for transport layers .
@Test
    public final void testGetTransportLayerCapabilitiesResponse() throws IOException
    {
        Message capsGen = TransportLayerCapabilitiesGen.TransportLayerCapabilities.newBuilder().
                setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder().
                    setManufacturer("TransportCaps Response Makers").
                    setDescription("A responsive transport layer.").
                    setProductName("CapsResponseTransportLayer")).
                build();
        Message response = GetCapabilitiesResponseData.newBuilder().
                setTransportCapabilities((TransportLayerCapabilitiesGen.TransportLayerCapabilities) capsGen).
                setCommType(CommType.TransportLayer).
                setProductType(TransportLayer.class.getName()).build();
        CustomCommsNamespace transportLayerMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.GetCapabilitiesResponse).
                setData(response.toByteString()).build();
        TerraHarvestPayload payload = createPayload(transportLayerMessage);
        TerraHarvestMessage message = createCustomCommsMessage(transportLayerMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event postedEvent = eventCaptor.getValue();
        assertThat((Message)postedEvent.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE), is(response));
    }
@ Test public final void testGetTransportLayerCapabilitiesResponse ( ) throws IOException { Message capsGen = TransportLayerCapabilitiesGen . TransportLayerCapabilities . newBuilder ( ) . setBase ( BaseCapabilitiesGen . BaseCapabilities . newBuilder ( ) . setManufacturer ( "TransportCaps Response Makers" ) . setDescription ( "A responsive transport layer." ) . setProductName ( "CapsResponseTransportLayer" ) ) . build ( ) ; Message response = GetCapabilitiesResponseData . newBuilder ( ) . setTransportCapabilities ( ( TransportLayerCapabilitiesGen . TransportLayerCapabilities ) capsGen ) . setCommType ( CommType . TransportLayer ) . setProductType ( TransportLayer . class . getName ( ) ) . build ( ) ; CustomCommsNamespace transportLayerMessage = CustomCommsNamespace . newBuilder ( ) . setType ( CustomCommsMessageType . GetCapabilitiesResponse ) . setData ( response . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( transportLayerMessage ) ; TerraHarvestMessage message = createCustomCommsMessage ( transportLayerMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event postedEvent = eventCaptor . getValue ( ) ; assertThat ( ( Message ) postedEvent . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( response ) ) ; }
Verify get capabilities response message will set the data event property correctly when handled
 for transport layers.
Verify get capabilities response message will set the data event property correctly when handled for transport layers .
//verify event is posted