mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestLinkLayerNamespace.java
@Test
    public void testGetPhysicalLink() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        // construct new link layer message type
        GetPhysicalLinkRequestData getPhysicalLinkRequest = GetPhysicalLinkRequestData.newBuilder().
                setUuid(linkUuid).
                build();
        
        LinkLayerNamespace.Builder linkLayerMessage = LinkLayerNamespace.newBuilder().
                setType(LinkLayerMessageType.GetPhysicalLinkRequest).
                setData(getPhysicalLinkRequest.toByteString());
        
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.LinkLayer, 
                linkLayerMessage);
        
        message.writeDelimitedTo(socket.getOutputStream());
        
        // listen for messages for a specific time interval
        LinkLayerNamespace response = (LinkLayerNamespace)listener.waitForMessage(Namespace.LinkLayer,
                LinkLayerMessageType.GetPhysicalLinkResponse, listenerTimeout);
        
        GetPhysicalLinkResponseData dataResponse = GetPhysicalLinkResponseData.parseFrom(
                response.getData());
        
        assertThat(dataResponse.getPhysicalLinkUuid(), is(pLinkUuid));
    }
/**
     * Assuming that a link layer was created in setup, verify that the physical link associated with the link layer 
     * is the physical link that was created first in the setup.
     */
Assuming that a link layer was created in setup, verify that the physical link associated with the link layer
is the physical link that was created first in the setup.
Assuming that a link layer was created in setup verify that the physical link associated with the link layer is the physical link that was created first in the setup .
@Test
    public void testGetPhysicalLink() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        GetPhysicalLinkRequestData getPhysicalLinkRequest = GetPhysicalLinkRequestData.newBuilder().
                setUuid(linkUuid).
                build();
        LinkLayerNamespace.Builder linkLayerMessage = LinkLayerNamespace.newBuilder().
                setType(LinkLayerMessageType.GetPhysicalLinkRequest).
                setData(getPhysicalLinkRequest.toByteString());
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.LinkLayer, 
                linkLayerMessage);
        message.writeDelimitedTo(socket.getOutputStream());
        LinkLayerNamespace response = (LinkLayerNamespace)listener.waitForMessage(Namespace.LinkLayer,
                LinkLayerMessageType.GetPhysicalLinkResponse, listenerTimeout);
        GetPhysicalLinkResponseData dataResponse = GetPhysicalLinkResponseData.parseFrom(
                response.getData());
        assertThat(dataResponse.getPhysicalLinkUuid(), is(pLinkUuid));
    }
@ Test public void testGetPhysicalLink ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; GetPhysicalLinkRequestData getPhysicalLinkRequest = GetPhysicalLinkRequestData . newBuilder ( ) . setUuid ( linkUuid ) . build ( ) ; LinkLayerNamespace . Builder linkLayerMessage = LinkLayerNamespace . newBuilder ( ) . setType ( LinkLayerMessageType . GetPhysicalLinkRequest ) . setData ( getPhysicalLinkRequest . toByteString ( ) ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . LinkLayer , linkLayerMessage ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; LinkLayerNamespace response = ( LinkLayerNamespace ) listener . waitForMessage ( Namespace . LinkLayer , LinkLayerMessageType . GetPhysicalLinkResponse , listenerTimeout ) ; GetPhysicalLinkResponseData dataResponse = GetPhysicalLinkResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getPhysicalLinkUuid ( ) , is ( pLinkUuid ) ) ; }
Assuming that a link layer was created in setup, verify that the physical link associated with the link layer
 is the physical link that was created first in the setup.
Assuming that a link layer was created in setup verify that the physical link associated with the link layer is the physical link that was created first in the setup .
// construct new link layer message type // listen for messages for a specific time interval