Package org.apache.jmeter.testelement.property

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


    public String getPropertyAsString(String key) {
        return getProperty(key).getStringValue();
    }

    public String getPropertyAsString(String key, String defaultValue) {
        JMeterProperty jmp = getProperty(key);
        return jmp instanceof NullProperty ? defaultValue : jmp.getStringValue();
    }
View Full Code Here


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

        if (prop instanceof NullProperty || (prop instanceof StringProperty && prop.getStringValue().equals(""))) {
            propMap.put(property.getName(), property);
        } else {
            prop.mergeIn(property);
        }
    }
View Full Code Here

     */
    protected void logProperties() {
        if (log.isDebugEnabled()) {
            PropertyIterator iter = propertyIterator();
            while (iter.hasNext()) {
                JMeterProperty prop = iter.next();
                log.debug("Property " + prop.getName() + " is temp? " + isTemporary(prop) + " and is a "
                        + prop.getObjectValue());
            }
        }
    }
View Full Code Here

    }

    protected void mergeIn(TestElement element) {
        PropertyIterator iter = element.propertyIterator();
        while (iter.hasNext()) {
            JMeterProperty prop = iter.next();
            addProperty(prop);
        }
    }
View Full Code Here

    public void recoverRunningVersion() {
        Iterator<Map.Entry<String, JMeterProperty>>  iter = propMap.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<String, JMeterProperty> entry = iter.next();
            JMeterProperty prop = entry.getValue();
            if (isTemporary(prop)) {
                iter.remove();
                clearTemporary(prop);
            } else {
                prop.recoverRunningVersion(this);
            }
        }
        emptyTemporary();
    }
View Full Code Here

        setMasterFunction(masterFunction);
        setVariables(variables);
    }

    public JMeterProperty transformValue(JMeterProperty prop) throws InvalidVariableException {
        JMeterProperty newValue = prop;
        getMasterFunction().clear();
        getMasterFunction().setParameters(prop.getStringValue());
        if (getMasterFunction().hasFunction()) {
            newValue = new FunctionProperty(prop.getName(), getMasterFunction().getFunction());
        }
View Full Code Here

    }

    private Collection<JMeterProperty> replaceValues(PropertyIterator iter, ValueTransformer transform) throws InvalidVariableException {
        List<JMeterProperty> props = new LinkedList<JMeterProperty>();
        while (iter.hasNext()) {
            JMeterProperty val = iter.next();
            if (log.isDebugEnabled()) {
                log.debug("About to replace in property of type: " + val.getClass() + ": " + val);
            }
            if (val instanceof StringProperty) {
                // 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);
                    }
                }
View Full Code Here

                setString(APPLICATION_X_WWW_FORM_URLENCODED);
                StringBuilder sb = new StringBuilder();
                boolean first = true;
                PropertyIterator args = getArguments().iterator();
                while(args.hasNext()) {
                    JMeterProperty arg = args.next();
                    if(first) {
                        first = false;
                    } else {
                        sb.append('&');
                    }
                    sb.append(arg.getStringValue());
                }
                stringBody = sb.toString();
                byte [] sbody = stringBody.getBytes(); // TODO - charset?
                cl = sbody.length;
                body = new ByteArrayInputStream(sbody);
View Full Code Here

    private static void checkElementCloning(TestElement item) {
        TestElement clonedItem = (TestElement) item.clone();
        cloneTesting(item, clonedItem);
        PropertyIterator iter2 = item.propertyIterator();
        while (iter2.hasNext()) {
            JMeterProperty item2 = iter2.next();
            // [sebb] assertEquals(item2,
            // clonedItem.getProperty(item2.getName()));
            assertEquals(item2.getStringValue(), clonedItem.getProperty(item2.getName()).getStringValue());
            assertTrue(item2 != clonedItem.getProperty(item2.getName()));
        }
    }
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

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.