mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestCustomCommsMessageService.java
@Test
    public final void testGetPhysicalLinkCapabilitiesResponse() throws IOException
    {
        Message capsGen = PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities.newBuilder().
                setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder().
                    setManufacturer("PhysicalCaps Response Makers").
                    setDescription("A responsive physical link.").
                    setProductName("CapsResponsePhysicalLink")).
                setLinkType(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT).build();
        Message response = GetCapabilitiesResponseData.newBuilder().
                setPhysicalCapabilities((PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities) capsGen).
                setCommType(CommType.PhysicalLink).
                setProductType(PhysicalLink.class.getName()).build();
        CustomCommsNamespace physicalLinkMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.GetCapabilitiesResponse).
                setData(response.toByteString()).build();
        TerraHarvestPayload payload = createPayload(physicalLinkMessage);
        TerraHarvestMessage message = createCustomCommsMessage(physicalLinkMessage);
        
        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 physical links.
     */
Verify get capabilities response message will set the data event property correctly when handled
for physical links.
Verify get capabilities response message will set the data event property correctly when handled for physical links .
@Test
    public final void testGetPhysicalLinkCapabilitiesResponse() throws IOException
    {
        Message capsGen = PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities.newBuilder().
                setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder().
                    setManufacturer("PhysicalCaps Response Makers").
                    setDescription("A responsive physical link.").
                    setProductName("CapsResponsePhysicalLink")).
                setLinkType(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT).build();
        Message response = GetCapabilitiesResponseData.newBuilder().
                setPhysicalCapabilities((PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities) capsGen).
                setCommType(CommType.PhysicalLink).
                setProductType(PhysicalLink.class.getName()).build();
        CustomCommsNamespace physicalLinkMessage = CustomCommsNamespace.newBuilder().
                setType(CustomCommsMessageType.GetCapabilitiesResponse).
                setData(response.toByteString()).build();
        TerraHarvestPayload payload = createPayload(physicalLinkMessage);
        TerraHarvestMessage message = createCustomCommsMessage(physicalLinkMessage);
        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 testGetPhysicalLinkCapabilitiesResponse ( ) throws IOException { Message capsGen = PhysicalLinkCapabilitiesGen . PhysicalLinkCapabilities . newBuilder ( ) . setBase ( BaseCapabilitiesGen . BaseCapabilities . newBuilder ( ) . setManufacturer ( "PhysicalCaps Response Makers" ) . setDescription ( "A responsive physical link." ) . setProductName ( "CapsResponsePhysicalLink" ) ) . setLinkType ( CustomCommTypesGen . PhysicalLinkType . Enum . SERIAL_PORT ) . build ( ) ; Message response = GetCapabilitiesResponseData . newBuilder ( ) . setPhysicalCapabilities ( ( PhysicalLinkCapabilitiesGen . PhysicalLinkCapabilities ) capsGen ) . setCommType ( CommType . PhysicalLink ) . setProductType ( PhysicalLink . class . getName ( ) ) . build ( ) ; CustomCommsNamespace physicalLinkMessage = CustomCommsNamespace . newBuilder ( ) . setType ( CustomCommsMessageType . GetCapabilitiesResponse ) . setData ( response . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( physicalLinkMessage ) ; TerraHarvestMessage message = createCustomCommsMessage ( physicalLinkMessage ) ; 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 physical links.
Verify get capabilities response message will set the data event property correctly when handled for physical links .
//verify event is posted