Package org.apache.jmeter.testelement.property

Examples of org.apache.jmeter.testelement.property.JMeterProperty


        Map props = new HashMap();
       
        PropertyIterator iter = propertyIterator();
        while (iter.hasNext())
        {
            JMeterProperty prop = iter.next();
            if (prop.getName().startsWith(JDBCSAMPLER_PROPERTY_PREFIX))
            {
                props.put(prop.getName(), prop);
            }
        }
        return props;
    }
View Full Code Here


        if (log.isDebugEnabled()) log.debug("Preparing "+this.getClass());
       
        for (PropertyIterator jprops= propertyIterator(); jprops.hasNext(); )
        {
            // Obtain a value of the appropriate type for this property.
            JMeterProperty jprop= jprops.next();
            PropertyDescriptor descriptor= (PropertyDescriptor)descriptors.get(jprop.getName());

            if (descriptor == null)
            {
              if (log.isDebugEnabled())
              {
          log.debug("Ignoring auxiliary property "+jprop.getName());
              }
        continue;
            }

            Class type= descriptor.getPropertyType();
            Object value= unwrapProperty(jprop, type);
           
      if (log.isDebugEnabled()) log.debug("Setting "+jprop.getName()+"="+value);

            // Set the bean's property to the value we just obtained:
      if (value != null || !type.isPrimitive())
        // We can't assign null to primitive types.
      {
View Full Code Here

    {
        for (PropertyIterator props= sampler.propertyIterator();
             props.hasNext();
            )
        {
            JMeterProperty prop= props.next();
            String name= prop.getName();
            String value= prop.getStringValue();

            // There's a few properties which are excluded from this processing:
            if (name.equals(TestElement.ENABLED)
                || name.equals(TestElement.GUI_CLASS)
                || name.equals(TestElement.NAME)
View Full Code Here

        super.configure(el);
        tableModel.clearData();
        PropertyIterator iter = el.propertyIterator();
        while (iter.hasNext())
        {
            JMeterProperty prop = iter.next();
            tableModel.addRow(
                new Object[] { prop.getName(), prop.getStringValue()});
        }
        checkDeleteStatus();
    }
View Full Code Here

            {
                element.removeProperty(name);
            }
            else
            {
                JMeterProperty jprop= wrapInProperty(propertyMap.get(name));
                jprop.setName(name);
                element.setProperty(jprop);
            }
        }
    }
View Full Code Here

        if (value instanceof JMeterProperty)
        {
            return (JMeterProperty)value;
        }
       
        JMeterProperty property;
        if (value == null)
        {
            property= new NullProperty();
        }
        else if (value instanceof Boolean)
        {
            property= new BooleanProperty();
        }
        else if (value instanceof Double)
        {
            property= new DoubleProperty();
        }
        else if (value instanceof Float)
        {
            property= new FloatProperty();
        }
        else if (value instanceof Integer)
        {
            property= new IntegerProperty();
        }
        else if (value instanceof Long)
        {
            property= new LongProperty();
        }
        else if (value instanceof String)
        {
            property= new StringProperty();
        }
        else if (value instanceof TestElement)
        {
            property= new TestElementProperty();
        }
        else throw new Error("Ouch!");

        property.setObjectValue(value);

        return property;
    }
View Full Code Here

        // Copy all property values into the map:
        propertyMap.clear();
        for (PropertyIterator jprops= element.propertyIterator(); jprops.hasNext(); )
        {
            JMeterProperty jprop= jprops.next();
            propertyMap.put(jprop.getName(), jprop.getObjectValue());
        }

        if (customizer != null)
        {
            customizer.setObject(propertyMap);
View Full Code Here

    *
    *@return    !ToDo (Return description)
    ***********************************************************/
   public int getTestType()
   {
      JMeterProperty type = getProperty(TEST_TYPE);
      if (type instanceof NullProperty)
      {
         return CONTAINS;
      }
      else
      {
         return type.getIntValue();
      }
   }
View Full Code Here

        return getPropertyAsString(MAXTHROUGHPUT);
    }

    protected int getMaxThroughputAsInt()
    {
        JMeterProperty prop = getProperty(MAXTHROUGHPUT);
        int retVal = 1;
        if (prop instanceof IntegerProperty)
        {
            retVal = (((IntegerProperty) prop).getIntValue());
        }
        else
        {
            try
            {
                retVal = Integer.parseInt(prop.getStringValue());
            }
            catch (NumberFormatException e)
            {
            }
        }
View Full Code Here

        return getPropertyAsString(PERCENTTHROUGHPUT);
    }

    protected float getPercentThroughputAsFloat()
    {
        JMeterProperty prop = getProperty(PERCENTTHROUGHPUT);
        float retVal = 100;
        if (prop instanceof FloatProperty)
        {
            retVal = (((FloatProperty) prop).getFloatValue());
        }
        else
        {
            try
            {
                retVal = Float.parseFloat(prop.getStringValue());
            }
            catch (NumberFormatException e)
            {
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.testelement.property.JMeterProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.