mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
private Event mockGetLayersResponseMergeLayers(final int systemId, String type, UUID uuid, String pid)
    {
        List<FactoryObjectInfo> layerInfos = new ArrayList<FactoryObjectInfo>();
        Message response = null;
        
        if(type.equals("transport"))
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(TransportLayer.class.getName()).build();
            
            layerInfos.add(factoryInfo);
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.TransportLayer).build();
        }
        else if(type.equals("link"))
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(LinkLayer.class.getName()).build();
            
            layerInfos.add(factoryInfo);
            
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.Linklayer).build();
        }
        else
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(PhysicalLink.class.getName()).build();
            
            layerInfos.add(factoryInfo);
            
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.PhysicalLink).build();
        }
        
        // properties for the event
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(RemoteConstants.EVENT_PROP_DATA_MESSAGE, response);
        props.put(RemoteConstants.EVENT_PROP_SOURCE_ID, systemId);
        props.put(RemoteConstants.EVENT_PROP_DEST_ID, 0);
        props.put(RemoteConstants.EVENT_PROP_NAMESPACE, Namespace.CustomComms.toString());
        props.put(RemoteConstants.EVENT_PROP_MESSAGE_TYPE, 
            CustomCommsMessageType.GetLayersResponse.toString());
        //the event
        return new Event(RemoteConstants.TOPIC_MESSAGE_RECEIVED, props);        
    }
/**
     * Helper method for mocking a GetLayersResponse from the controller.
     */
Helper method for mocking a GetLayersResponse from the controller.
Helper method for mocking a GetLayersResponse from the controller .
private Event mockGetLayersResponseMergeLayers(final int systemId, String type, UUID uuid, String pid)
    {
        List<FactoryObjectInfo> layerInfos = new ArrayList<FactoryObjectInfo>();
        Message response = null;
        if(type.equals("transport"))
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(TransportLayer.class.getName()).build();
            layerInfos.add(factoryInfo);
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.TransportLayer).build();
        }
        else if(type.equals("link"))
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(LinkLayer.class.getName()).build();
            layerInfos.add(factoryInfo);
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.Linklayer).build();
        }
        else
        {
            FactoryObjectInfo factoryInfo = FactoryObjectInfo.newBuilder().
                    setPid(pid).
                    setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).
                    setProductType(PhysicalLink.class.getName()).build();
            layerInfos.add(factoryInfo);
            response = GetLayersResponseData.newBuilder().addAllLayerInfo(layerInfos).
                    setCommType(CommType.PhysicalLink).build();
        }
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(RemoteConstants.EVENT_PROP_DATA_MESSAGE, response);
        props.put(RemoteConstants.EVENT_PROP_SOURCE_ID, systemId);
        props.put(RemoteConstants.EVENT_PROP_DEST_ID, 0);
        props.put(RemoteConstants.EVENT_PROP_NAMESPACE, Namespace.CustomComms.toString());
        props.put(RemoteConstants.EVENT_PROP_MESSAGE_TYPE, 
            CustomCommsMessageType.GetLayersResponse.toString());
        return new Event(RemoteConstants.TOPIC_MESSAGE_RECEIVED, props);        
    }
private Event mockGetLayersResponseMergeLayers ( final int systemId , String type , UUID uuid , String pid ) { List < FactoryObjectInfo > layerInfos = new ArrayList < FactoryObjectInfo > ( ) ; Message response = null ; if ( type . equals ( "transport" ) ) { FactoryObjectInfo factoryInfo = FactoryObjectInfo . newBuilder ( ) . setPid ( pid ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) . setProductType ( TransportLayer . class . getName ( ) ) . build ( ) ; layerInfos . add ( factoryInfo ) ; response = GetLayersResponseData . newBuilder ( ) . addAllLayerInfo ( layerInfos ) . setCommType ( CommType . TransportLayer ) . build ( ) ; } else if ( type . equals ( "link" ) ) { FactoryObjectInfo factoryInfo = FactoryObjectInfo . newBuilder ( ) . setPid ( pid ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) . setProductType ( LinkLayer . class . getName ( ) ) . build ( ) ; layerInfos . add ( factoryInfo ) ; response = GetLayersResponseData . newBuilder ( ) . addAllLayerInfo ( layerInfos ) . setCommType ( CommType . Linklayer ) . build ( ) ; } else { FactoryObjectInfo factoryInfo = FactoryObjectInfo . newBuilder ( ) . setPid ( pid ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) . setProductType ( PhysicalLink . class . getName ( ) ) . build ( ) ; layerInfos . add ( factoryInfo ) ; response = GetLayersResponseData . newBuilder ( ) . addAllLayerInfo ( layerInfos ) . setCommType ( CommType . PhysicalLink ) . build ( ) ; } final Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( RemoteConstants . EVENT_PROP_DATA_MESSAGE , response ) ; props . put ( RemoteConstants . EVENT_PROP_SOURCE_ID , systemId ) ; props . put ( RemoteConstants . EVENT_PROP_DEST_ID , 0 ) ; props . put ( RemoteConstants . EVENT_PROP_NAMESPACE , Namespace . CustomComms . toString ( ) ) ; props . put ( RemoteConstants . EVENT_PROP_MESSAGE_TYPE , CustomCommsMessageType . GetLayersResponse . toString ( ) ) ; return new Event ( RemoteConstants . TOPIC_MESSAGE_RECEIVED , props ) ; }
Helper method for mocking a GetLayersResponse from the controller.
Helper method for mocking a GetLayersResponse from the controller .
// properties for the event //the event