mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestLinkLayerNamespace.java
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
    
        GetCapabilitiesRequestData linkLayerCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.Linklayer).setProductType(ExampleLinkLayer.class.getName()).build();
    
        TerraHarvestMessage message= createLinkLayerMessage(CustomCommsMessageType.GetCapabilitiesRequest,
                linkLayerCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1500);
        
        //method call will only return messages of type GetCapabilitiesResponse
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
    
        //test various capabilities
        assertThat(dataResponse.getLinkCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getLinkCapabilities().getBase().getDescription(), is("Example Link Layer"));
        assertThat(dataResponse.getLinkCapabilities().getBase().getManufacturer(), is("Example Manufacturer"));
        assertThat(dataResponse.getLinkCapabilities().getModality(), 
                is(CustomCommTypesGen.LinkLayerType.Enum.LINE_OF_SIGHT));
        assertThat(dataResponse.getLinkCapabilities().getStaticMtu(), is(false));
        assertThat(dataResponse.getLinkCapabilities().getPerformBITSupported(), is(true));
        assertThat(dataResponse.getLinkCapabilities().getPhysicalLinkRequired(), is(true));
        assertThat(dataResponse.getLinkCapabilities().getPhysicalLinksSupportedList().get(0),
                is(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT));
        assertThat(dataResponse.getLinkCapabilities().getBase().getProductName(), is("ExampleLinkLayer"));
    }
/**
     * Verifies the ability of the system to get a link layer's capabilities remotely.
     */
Verifies the ability of the system to get a link layer's capabilities remotely.
Verifies the ability of the system to get a link layer ' s capabilities remotely .
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        GetCapabilitiesRequestData linkLayerCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.Linklayer).setProductType(ExampleLinkLayer.class.getName()).build();
        TerraHarvestMessage message= createLinkLayerMessage(CustomCommsMessageType.GetCapabilitiesRequest,
                linkLayerCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1500);
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getLinkCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getLinkCapabilities().getBase().getDescription(), is("Example Link Layer"));
        assertThat(dataResponse.getLinkCapabilities().getBase().getManufacturer(), is("Example Manufacturer"));
        assertThat(dataResponse.getLinkCapabilities().getModality(), 
                is(CustomCommTypesGen.LinkLayerType.Enum.LINE_OF_SIGHT));
        assertThat(dataResponse.getLinkCapabilities().getStaticMtu(), is(false));
        assertThat(dataResponse.getLinkCapabilities().getPerformBITSupported(), is(true));
        assertThat(dataResponse.getLinkCapabilities().getPhysicalLinkRequired(), is(true));
        assertThat(dataResponse.getLinkCapabilities().getPhysicalLinksSupportedList().get(0),
                is(CustomCommTypesGen.PhysicalLinkType.Enum.SERIAL_PORT));
        assertThat(dataResponse.getLinkCapabilities().getBase().getProductName(), is("ExampleLinkLayer"));
    }
@ Test public final void testGetCapabilities ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; GetCapabilitiesRequestData linkLayerCapsRequest = GetCapabilitiesRequestData . newBuilder ( ) . setCommType ( CommType . Linklayer ) . setProductType ( ExampleLinkLayer . class . getName ( ) ) . build ( ) ; TerraHarvestMessage message = createLinkLayerMessage ( CustomCommsMessageType . GetCapabilitiesRequest , linkLayerCapsRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; CustomCommsNamespace response = ( CustomCommsNamespace ) listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . GetCapabilitiesResponse , 1500 ) ; GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) , is ( notNullValue ( ) ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getBase ( ) . getDescription ( ) , is ( "Example Link Layer" ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getBase ( ) . getManufacturer ( ) , is ( "Example Manufacturer" ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getModality ( ) , is ( CustomCommTypesGen . LinkLayerType . Enum . LINE_OF_SIGHT ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getStaticMtu ( ) , is ( false ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getPerformBITSupported ( ) , is ( true ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getPhysicalLinkRequired ( ) , is ( true ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getPhysicalLinksSupportedList ( ) . get ( 0 ) , is ( CustomCommTypesGen . PhysicalLinkType . Enum . SERIAL_PORT ) ) ; assertThat ( dataResponse . getLinkCapabilities ( ) . getBase ( ) . getProductName ( ) , is ( "ExampleLinkLayer" ) ) ; }
Verifies the ability of the system to get a link layer's capabilities remotely.
Verifies the ability of the system to get a link layer ' s capabilities remotely .
//listen for messages for a specific time interval //method call will only return messages of type GetCapabilitiesResponse //test various capabilities