mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestPhysicalLinkNamespace.java
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
    
        GetCapabilitiesRequestData physicalLinkCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.PhysicalLink).setProductType(ExamplePhysicalLink.class.getName()).build();
    
        TerraHarvestMessage message= createCustomCommsMessage(CustomCommsMessageType.GetCapabilitiesRequest, 
                physicalLinkCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        
        //listen for messages for a specific time interval
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1000);

        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
    
        //test various capabilities
        assertThat(dataResponse.getPhysicalCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getDescription(), is("An example physical link"));
        assertThat(dataResponse.getPhysicalCapabilities().getLinkType(), 
                is(CustomCommTypesGen.PhysicalLinkType.Enum.I_2_C));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getManufacturer(), is("ExampleManufacturer"));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getProductName(), is("ExamplePhysicalLink"));
    }
/**
     * Verifies the ability of the system to get a physical link's capabilities remotely.
     */
Verifies the ability of the system to get a physical link's capabilities remotely.
Verifies the ability of the system to get a physical link ' s capabilities remotely .
@Test
    public final void testGetCapabilities() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        GetCapabilitiesRequestData physicalLinkCapsRequest = GetCapabilitiesRequestData.newBuilder().
                setCommType(CommType.PhysicalLink).setProductType(ExamplePhysicalLink.class.getName()).build();
        TerraHarvestMessage message= createCustomCommsMessage(CustomCommsMessageType.GetCapabilitiesRequest, 
                physicalLinkCapsRequest);
        message.writeDelimitedTo(socket.getOutputStream());
        CustomCommsNamespace response = (CustomCommsNamespace)listener.waitForMessage(Namespace.CustomComms,
                CustomCommsMessageType.GetCapabilitiesResponse, 1000);
        GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getPhysicalCapabilities(), is(notNullValue()));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getDescription(), is("An example physical link"));
        assertThat(dataResponse.getPhysicalCapabilities().getLinkType(), 
                is(CustomCommTypesGen.PhysicalLinkType.Enum.I_2_C));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getManufacturer(), is("ExampleManufacturer"));
        assertThat(dataResponse.getPhysicalCapabilities().getBase().getProductName(), is("ExamplePhysicalLink"));
    }
@ Test public final void testGetCapabilities ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; GetCapabilitiesRequestData physicalLinkCapsRequest = GetCapabilitiesRequestData . newBuilder ( ) . setCommType ( CommType . PhysicalLink ) . setProductType ( ExamplePhysicalLink . class . getName ( ) ) . build ( ) ; TerraHarvestMessage message = createCustomCommsMessage ( CustomCommsMessageType . GetCapabilitiesRequest , physicalLinkCapsRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; CustomCommsNamespace response = ( CustomCommsNamespace ) listener . waitForMessage ( Namespace . CustomComms , CustomCommsMessageType . GetCapabilitiesResponse , 1000 ) ; GetCapabilitiesResponseData dataResponse = GetCapabilitiesResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getPhysicalCapabilities ( ) , is ( notNullValue ( ) ) ) ; assertThat ( dataResponse . getPhysicalCapabilities ( ) . getBase ( ) . getDescription ( ) , is ( "An example physical link" ) ) ; assertThat ( dataResponse . getPhysicalCapabilities ( ) . getLinkType ( ) , is ( CustomCommTypesGen . PhysicalLinkType . Enum . I_2_C ) ) ; assertThat ( dataResponse . getPhysicalCapabilities ( ) . getBase ( ) . getManufacturer ( ) , is ( "ExampleManufacturer" ) ) ; assertThat ( dataResponse . getPhysicalCapabilities ( ) . getBase ( ) . getProductName ( ) , is ( "ExamplePhysicalLink" ) ) ; }
Verifies the ability of the system to get a physical link's capabilities remotely.
Verifies the ability of the system to get a physical link ' s capabilities remotely .
//listen for messages for a specific time interval //test various capabilities