mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
@Test
    public void testCreateLinkLayerResponseHandler()
    {
        CreateTransportLayerRequestData.Builder transportBuild = CreateTransportLayerRequestData.newBuilder().
                setTransportLayerName("immaTranny").
                setTransportLayerProductType(CommsLayerBaseModel.class.getName()); 
        
        RemoteCreateLinkLayerHandler handler = m_SUT.createLinkLayerHandler(transportBuild);

        //response messages to process
        UUID linkUuid = UUID.randomUUID();
        
        FactoryObjectInfo info = FactoryObjectInfo.newBuilder()
                .setPid("myPid")
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(linkUuid))
                .setProductType("testLinkLayer")
                .build();
        
        CreateLinkLayerResponseData response = CreateLinkLayerResponseData.newBuilder()
                .setInfo(info)
                .build();

        CustomCommsNamespace nameResponse1 = CustomCommsNamespace.newBuilder().
            setData(response.toByteString()).
            setType(CustomCommsMessageType.CreateLinkLayerResponse).build();

        TerraHarvestPayload payload1 = TerraHarvestPayload.newBuilder().setNamespace(Namespace.CustomComms).
            setNamespaceMessage(response.toByteString()).build();  
            
        TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.CustomComms, 123, nameResponse1);
        
        //handle fake response
        handler.handleResponse(thMessage1, payload1, nameResponse1, response);
        
        //verify that handler will send create transport layer request
        verify(m_MessageFactory).createCustomCommsMessage(eq(CustomCommsMessageType.CreateTransportLayerRequest),
            Mockito.any(Message.class));
        verify(m_MessageWrapper).queue(eq(systemId1), (ResponseHandler) eq(null));
    }
/**
     * Test the handling of create link layer response handler.
     * Verify the handler sends create transport layer requests.
     */
Test the handling of create link layer response handler.
Verify the handler sends create transport layer requests.
Test the handling of create link layer response handler . Verify the handler sends create transport layer requests .
@Test
    public void testCreateLinkLayerResponseHandler()
    {
        CreateTransportLayerRequestData.Builder transportBuild = CreateTransportLayerRequestData.newBuilder().
                setTransportLayerName("immaTranny").
                setTransportLayerProductType(CommsLayerBaseModel.class.getName()); 
        RemoteCreateLinkLayerHandler handler = m_SUT.createLinkLayerHandler(transportBuild);
        UUID linkUuid = UUID.randomUUID();
        FactoryObjectInfo info = FactoryObjectInfo.newBuilder()
                .setPid("myPid")
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(linkUuid))
                .setProductType("testLinkLayer")
                .build();
        CreateLinkLayerResponseData response = CreateLinkLayerResponseData.newBuilder()
                .setInfo(info)
                .build();
        CustomCommsNamespace nameResponse1 = CustomCommsNamespace.newBuilder().
            setData(response.toByteString()).
            setType(CustomCommsMessageType.CreateLinkLayerResponse).build();
        TerraHarvestPayload payload1 = TerraHarvestPayload.newBuilder().setNamespace(Namespace.CustomComms).
            setNamespaceMessage(response.toByteString()).build();  
        TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.CustomComms, 123, nameResponse1);
        handler.handleResponse(thMessage1, payload1, nameResponse1, response);
        verify(m_MessageFactory).createCustomCommsMessage(eq(CustomCommsMessageType.CreateTransportLayerRequest),
            Mockito.any(Message.class));
        verify(m_MessageWrapper).queue(eq(systemId1), (ResponseHandler) eq(null));
    }
@ Test public void testCreateLinkLayerResponseHandler ( ) { CreateTransportLayerRequestData . Builder transportBuild = CreateTransportLayerRequestData . newBuilder ( ) . setTransportLayerName ( "immaTranny" ) . setTransportLayerProductType ( CommsLayerBaseModel . class . getName ( ) ) ; RemoteCreateLinkLayerHandler handler = m_SUT . createLinkLayerHandler ( transportBuild ) ; UUID linkUuid = UUID . randomUUID ( ) ; FactoryObjectInfo info = FactoryObjectInfo . newBuilder ( ) . setPid ( "myPid" ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( linkUuid ) ) . setProductType ( "testLinkLayer" ) . build ( ) ; CreateLinkLayerResponseData response = CreateLinkLayerResponseData . newBuilder ( ) . setInfo ( info ) . build ( ) ; CustomCommsNamespace nameResponse1 = CustomCommsNamespace . newBuilder ( ) . setData ( response . toByteString ( ) ) . setType ( CustomCommsMessageType . CreateLinkLayerResponse ) . build ( ) ; TerraHarvestPayload payload1 = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . CustomComms ) . setNamespaceMessage ( response . toByteString ( ) ) . build ( ) ; TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper . createTerraHarvestMessage ( systemId1 , 0 , Namespace . CustomComms , 123 , nameResponse1 ) ; handler . handleResponse ( thMessage1 , payload1 , nameResponse1 , response ) ; verify ( m_MessageFactory ) . createCustomCommsMessage ( eq ( CustomCommsMessageType . CreateTransportLayerRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( systemId1 ) , ( ResponseHandler ) eq ( null ) ) ; }
Test the handling of create link layer response handler.
Test the handling of create link layer response handler .
//response messages to process //handle fake response //verify that handler will send create transport layer request