mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestLinkLayerNamespace.java
@Test
    public void testIsActivated() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        
        // construct new link layer message type
        IsActivatedRequestData isActivatedRequest = IsActivatedRequestData.newBuilder().
                setUuid(linkUuid).
                build();
        
        LinkLayerNamespace.Builder linkLayerMessage = LinkLayerNamespace.newBuilder().
                setType(LinkLayerMessageType.IsActivatedRequest).
                setData(isActivatedRequest.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.IsActivatedResponse, listenerTimeout);
       
        IsActivatedResponseData dataResponse = IsActivatedResponseData.parseFrom(response.getData());
        
        assertThat(dataResponse.getIsActivated(), is(false));
    }
/**
     * Assuming link layer was created in the setup, verify that it defaults to deactivated.
     */
Assuming link layer was created in the setup, verify that it defaults to deactivated.
Assuming link layer was created in the setup verify that it defaults to deactivated .
@Test
    public void testIsActivated() throws IOException, InterruptedException
    {
        MessageListener listener = new MessageListener(socket);
        IsActivatedRequestData isActivatedRequest = IsActivatedRequestData.newBuilder().
                setUuid(linkUuid).
                build();
        LinkLayerNamespace.Builder linkLayerMessage = LinkLayerNamespace.newBuilder().
                setType(LinkLayerMessageType.IsActivatedRequest).
                setData(isActivatedRequest.toByteString());
        TerraHarvestMessage message = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.LinkLayer, 
                linkLayerMessage);
        message.writeDelimitedTo(socket.getOutputStream());
        LinkLayerNamespace response = (LinkLayerNamespace)listener.waitForMessage(Namespace.LinkLayer,
                LinkLayerMessageType.IsActivatedResponse, listenerTimeout);
        IsActivatedResponseData dataResponse = IsActivatedResponseData.parseFrom(response.getData());
        assertThat(dataResponse.getIsActivated(), is(false));
    }
@ Test public void testIsActivated ( ) throws IOException , InterruptedException { MessageListener listener = new MessageListener ( socket ) ; IsActivatedRequestData isActivatedRequest = IsActivatedRequestData . newBuilder ( ) . setUuid ( linkUuid ) . build ( ) ; LinkLayerNamespace . Builder linkLayerMessage = LinkLayerNamespace . newBuilder ( ) . setType ( LinkLayerMessageType . IsActivatedRequest ) . setData ( isActivatedRequest . toByteString ( ) ) ; TerraHarvestMessage message = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . LinkLayer , linkLayerMessage ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; LinkLayerNamespace response = ( LinkLayerNamespace ) listener . waitForMessage ( Namespace . LinkLayer , LinkLayerMessageType . IsActivatedResponse , listenerTimeout ) ; IsActivatedResponseData dataResponse = IsActivatedResponseData . parseFrom ( response . getData ( ) ) ; assertThat ( dataResponse . getIsActivated ( ) , is ( false ) ) ; }
Assuming link layer was created in the setup, verify that it defaults to deactivated.
Assuming link layer was created in the setup verify that it defaults to deactivated .
// construct new link layer message type // listen for messages for a specific time interval