mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsLayerTypesMgrImpl.java
private void handleTestCapabiltiesMessage(String className, PhysicalLinkTypeEnum type)
        throws ObjectConverterException
    {
        CapabilitiesResponseHandler handler = m_SUT.new CapabilitiesResponseHandler(className);
        BaseCapabilities baseCaps = BaseCapabilities.newBuilder()
                .setDescription("fancy description")
                .setProductName("fancyName")
                .build();
        PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities caps = 
                PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities.newBuilder()
                .setBase(baseCaps)
                .setLinkType(PhysicalLinkTypeEnumConverter.convertJavaEnumToProto(type)).build();

        //response messages to process
        GetCapabilitiesResponseData response = GetCapabilitiesResponseData.newBuilder().
                setCommType(CommType.PhysicalLink).setProductType(className).
                setPhysicalCapabilities(caps).build();
        
        CustomCommsNamespace nameResponse = CustomCommsNamespace.newBuilder().
                setData(response.toByteString()).
                setType(CustomCommsMessageType.GetCapabilitiesResponse).build();

        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.CustomComms).
            setNamespaceMessage(response.toByteString()).build();  
            
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.CustomComms, 123, nameResponse);

        when(m_Converter.convertToJaxb(Mockito.any(Message.class))).thenReturn(
                new PhysicalLinkCapabilities().withLinkType(type));
        
        //handle fake response
        handler.handleResponse(thMessage, payload, nameResponse, response);
    }
/**
     * Mock interaction with SUT to receive capabilities for the test physical link plug-in. 
     */
Mock interaction with SUT to receive capabilities for the test physical link plug-in.
Mock interaction with SUT to receive capabilities for the test physical link plug - in .
private void handleTestCapabiltiesMessage(String className, PhysicalLinkTypeEnum type)
        throws ObjectConverterException
    {
        CapabilitiesResponseHandler handler = m_SUT.new CapabilitiesResponseHandler(className);
        BaseCapabilities baseCaps = BaseCapabilities.newBuilder()
                .setDescription("fancy description")
                .setProductName("fancyName")
                .build();
        PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities caps = 
                PhysicalLinkCapabilitiesGen.PhysicalLinkCapabilities.newBuilder()
                .setBase(baseCaps)
                .setLinkType(PhysicalLinkTypeEnumConverter.convertJavaEnumToProto(type)).build();
        GetCapabilitiesResponseData response = GetCapabilitiesResponseData.newBuilder().
                setCommType(CommType.PhysicalLink).setProductType(className).
                setPhysicalCapabilities(caps).build();
        CustomCommsNamespace nameResponse = CustomCommsNamespace.newBuilder().
                setData(response.toByteString()).
                setType(CustomCommsMessageType.GetCapabilitiesResponse).build();
        TerraHarvestPayload payload = TerraHarvestPayload.newBuilder().setNamespace(Namespace.CustomComms).
            setNamespaceMessage(response.toByteString()).build();  
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(systemId1, 0,
            Namespace.CustomComms, 123, nameResponse);
        when(m_Converter.convertToJaxb(Mockito.any(Message.class))).thenReturn(
                new PhysicalLinkCapabilities().withLinkType(type));
        handler.handleResponse(thMessage, payload, nameResponse, response);
    }
private void handleTestCapabiltiesMessage ( String className , PhysicalLinkTypeEnum type ) throws ObjectConverterException { CapabilitiesResponseHandler handler = m_SUT . new CapabilitiesResponseHandler ( className ) ; BaseCapabilities baseCaps = BaseCapabilities . newBuilder ( ) . setDescription ( "fancy description" ) . setProductName ( "fancyName" ) . build ( ) ; PhysicalLinkCapabilitiesGen . PhysicalLinkCapabilities caps = PhysicalLinkCapabilitiesGen . PhysicalLinkCapabilities . newBuilder ( ) . setBase ( baseCaps ) . setLinkType ( PhysicalLinkTypeEnumConverter . convertJavaEnumToProto ( type ) ) . build ( ) ; GetCapabilitiesResponseData response = GetCapabilitiesResponseData . newBuilder ( ) . setCommType ( CommType . PhysicalLink ) . setProductType ( className ) . setPhysicalCapabilities ( caps ) . build ( ) ; CustomCommsNamespace nameResponse = CustomCommsNamespace . newBuilder ( ) . setData ( response . toByteString ( ) ) . setType ( CustomCommsMessageType . GetCapabilitiesResponse ) . build ( ) ; TerraHarvestPayload payload = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . CustomComms ) . setNamespaceMessage ( response . toByteString ( ) ) . build ( ) ; TerraHarvestMessage thMessage = TerraHarvestMessageHelper . createTerraHarvestMessage ( systemId1 , 0 , Namespace . CustomComms , 123 , nameResponse ) ; when ( m_Converter . convertToJaxb ( Mockito . any ( Message . class ) ) ) . thenReturn ( new PhysicalLinkCapabilities ( ) . withLinkType ( type ) ) ; handler . handleResponse ( thMessage , payload , nameResponse , response ) ; }
Mock interaction with SUT to receive capabilities for the test physical link plug-in.
Mock interaction with SUT to receive capabilities for the test physical link plug - in .
//response messages to process //handle fake response