Exemplo n.º 1
0
        /**
         * Add property to test element
         * @param property {@link JMeterProperty} to add to current Test Element
         * @param clone clone property
         */
        protected void addProperty(NetMeterProperty property, bool clone)
        {
            NetMeterProperty propertyToPut = property;

            if (clone)
            {
                propertyToPut = property.clone();
            }
            if (isRunningVersion())
            {
                setTemporary(propertyToPut);
            }
            else
            {
                clearTemporary(property);
            }
            NetMeterProperty prop = getProperty(property.getName());

            if (prop is NullProperty || (prop is StringProperty && prop.getStringValue().Equals("")))
            {
                propDic.Add(property.getName(), propertyToPut);
            }
            else
            {
                prop.mergeIn(propertyToPut);
            }
        }
Exemplo n.º 2
0
        private LinkedList <NetMeterProperty> ReplaceValues(PropertyIterator iter, ValueTransformer transform)
        {
            LinkedList <NetMeterProperty> props = new LinkedList <NetMeterProperty>();

            while (iter.hasNext())
            {
                NetMeterProperty val = iter.next();
                if (log.IsDebugEnabled)
                {
                    log.Debug("About to replace in property of type: " + val.GetType() + ": " + val);
                }
                if (typeof(StringProperty).IsAssignableFrom(val.GetType()))
                {
                    // Must not convert TestElement.gui_class etc
                    if (!val.getName().Equals(TestElement.GUI_CLASS) &&
                        !val.getName().Equals(TestElement.TEST_CLASS))
                    {
                        val = transform.transformValue(val);
                        if (log.IsDebugEnabled)
                        {
                            log.Debug("Replacement result: " + val);
                        }
                    }
                }
                else if (typeof(MultiProperty).IsAssignableFrom(val.GetType()))
                {
                    MultiProperty multiVal = (MultiProperty)val;
                    LinkedList <NetMeterProperty> newValues = ReplaceValues(multiVal.iterator(), transform);
                    multiVal.Clear();
                    foreach (NetMeterProperty jmp in newValues)
                    {
                        multiVal.addProperty(jmp);
                    }
                    if (log.IsDebugEnabled)
                    {
                        log.Debug("Replacement result: " + multiVal);
                    }
                }
                else
                {
                    if (log.IsDebugEnabled)
                    {
                        log.Debug("Won't replace " + val);
                    }
                }
                props.AddLast(val);
            }
            return(props);
        }
Exemplo n.º 3
0
 public void SetProperty(NetMeterProperty property)
 {
     if (isRunningVersion())
     {
         if (getProperty(property.getName()) is NullProperty)
         {
             addProperty(property);
         }
         else
         {
             getProperty(property.getName()).setObjectValue(property.getObjectValue());
         }
     }
     else
     {
         propDic.Add(property.getName(), property);
     }
 }
Exemplo n.º 4
0
        /**
         * Add to result the values of propertyNames
         * @param result List<String> values of propertyNames
         * @param propertyNames Set<String> properties to extract
         */
        protected sealed void addPropertiesValues(List <String> result, HashSet <String> propertyNames)
        {
            PropertyIterator iterator = propertyIterator();

            while (iterator.hasNext())
            {
                NetMeterProperty jMeterProperty = iterator.next();
                if (propertyNames.Contains(jMeterProperty.getName()))
                {
                    result.Add(jMeterProperty.getStringValue());
                }
            }
        }
Exemplo n.º 5
0
        /**
         * {@inheritDoc}}
         */
        public List <String> getSearchableTokens()
        {
            List <String> result = new List <String>(25);

            foreach (String res in result)
            {
            }

            PropertyIterator iterator = propertyIterator();

            while (iterator.hasNext())
            {
                NetMeterProperty jMeterProperty = iterator.next();
                result.Add(jMeterProperty.getName());
                result.Add(jMeterProperty.getStringValue());
            }
            return(result);
        }
Exemplo n.º 6
0
        /**
         * Add property to test element
         * @param property {@link JMeterProperty} to add to current Test Element
         * @param clone clone property
         */
        protected void addProperty(NetMeterProperty property, bool clone)
        {
            NetMeterProperty propertyToPut = property;
            if(clone) {
                propertyToPut = property.clone();
            }
            if (isRunningVersion()) {
                setTemporary(propertyToPut);
            } else {
                clearTemporary(property);
            }
            NetMeterProperty prop = getProperty(property.getName());

            if (prop is NullProperty || (prop is StringProperty && prop.getStringValue().Equals(""))) {
                propDic.Add(property.getName(), propertyToPut);
            } else {
                prop.mergeIn(propertyToPut);
            }
        }
Exemplo n.º 7
0
 public void SetProperty(NetMeterProperty property)
 {
     if (isRunningVersion()) {
         if (getProperty(property.getName()) is NullProperty)
         {
             addProperty(property);
         }
         else
         {
             getProperty(property.getName()).setObjectValue(property.getObjectValue());
         }
     }
     else
     {
         propDic.Add(property.getName(), property);
     }
 }