Package org.apache.jmeter.testelement.property

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


        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


        setProperty(new CollectionProperty(NODE_PATH, nodePath));
    }

    private Vector getNodePath()
    {
        JMeterProperty prop = getProperty(NODE_PATH);
        if (!(prop instanceof NullProperty))
        {
            return (Vector) ((CollectionProperty) prop).getObjectValue();
        }
        else
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

        smtpPanel.setBody(element.getPropertyAsString(SmtpSampler.MESSAGE));
        smtpPanel.setPlainBody(element.getPropertyAsBoolean(SmtpSampler.PLAIN_BODY));
        smtpPanel.setSubject(element.getPropertyAsString(SmtpSampler.SUBJECT));
        smtpPanel.setSuppressSubject(element.getPropertyAsBoolean(SmtpSampler.SUPPRESS_SUBJECT));
        smtpPanel.setIncludeTimestamp(element.getPropertyAsBoolean(SmtpSampler.INCLUDE_TIMESTAMP));
        JMeterProperty headers = element.getProperty(SmtpSampler.HEADER_FIELDS);
        if (headers instanceof CollectionProperty) { // Might be NullProperty
            smtpPanel.setHeaderFields((CollectionProperty)headers);           
        } else {
            smtpPanel.setHeaderFields(new CollectionProperty());
        }
View Full Code Here

     * @param configurations
     *            ConfigTestElements in descending priority.
     */
    private void removeValuesFromSampler(HTTPSamplerBase sampler, Collection<ConfigTestElement> configurations) {
        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)
                    || name.equals(TestElement.TEST_CLASS)) {
                continue; // go on with next property.
View Full Code Here

    }

    private void formatPropertyIterator(StringBuilder sb, PropertyIterator iter) {
        Map<String, String> map = new HashMap<String, String>();
        while (iter.hasNext()) {
            JMeterProperty item = iter.next();
            map.put(item.getName(), item.getStringValue());
        }
        formatSet(sb, map.entrySet());
    }
View Full Code Here

        }
        PrintWriter writer = new PrintWriter(new FileWriter(file)); // TODO Charset ?
        writer.println("# JMeter generated Header file");// $NON-NLS-1$
        final CollectionProperty hdrs = getHeaders();
        for (int i = 0; i < hdrs.size(); i++) {
            final JMeterProperty hdr = hdrs.get(i);
            Header head = (Header) hdr.getObjectValue();
            writer.println(head.toString());
        }
        writer.flush();
        writer.close();
    }
View Full Code Here

    public void configure(TestElement el) {
        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

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.