Search in sources :

Example 11 with JMeterProperty

use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.

the class TestPlanGui method configure.

/**
     * A newly created component can be initialized with the contents of a Test
     * Element object by calling this method. The component is responsible for
     * querying the Test Element object for the relevant information to display
     * in its GUI.
     *
     * @param el
     *            the TestElement to configure
     */
@Override
public void configure(TestElement el) {
    super.configure(el);
    if (el instanceof TestPlan) {
        TestPlan tp = (TestPlan) el;
        functionalMode.setSelected(tp.isFunctionalMode());
        serializedMode.setSelected(tp.isSerialized());
        tearDownOnShutdown.setSelected(tp.isTearDownOnShutdown());
        final JMeterProperty udv = tp.getUserDefinedVariablesAsProperty();
        if (udv != null) {
            argsPanel.configure((Arguments) udv.getObjectValue());
        }
        browseJar.setFiles(tp.getTestPlanClasspathArray());
    }
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) TestPlan(org.apache.jmeter.testelement.TestPlan)

Example 12 with JMeterProperty

use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.

the class ArgumentsPanel method configure.

/**
     * A newly created component can be initialized with the contents of a Test
     * Element object by calling this method. The component is responsible for
     * querying the Test Element object for the relevant information to display
     * in its GUI.
     *
     * @param el the TestElement to configure
     */
@Override
public void configure(TestElement el) {
    super.configure(el);
    if (el instanceof Arguments) {
        tableModel.clearData();
        for (JMeterProperty jMeterProperty : (Arguments) el) {
            Argument arg = (Argument) jMeterProperty.getObjectValue();
            tableModel.addRow(arg);
        }
    }
    checkButtonsStatus();
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) Argument(org.apache.jmeter.config.Argument) Arguments(org.apache.jmeter.config.Arguments)

Example 13 with JMeterProperty

use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.

the class SimpleConfigGui method configure.

/**
     * A newly created component can be initialized with the contents of a Test
     * Element object by calling this method. The component is responsible for
     * querying the Test Element object for the relevant information to display
     * in its GUI.
     * <p>
     * This implementation retrieves all key/value pairs from the TestElement
     * object and sets these values in the GUI.
     *
     * @param el
     *            the TestElement to configure
     */
@Override
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();
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) PropertyIterator(org.apache.jmeter.testelement.property.PropertyIterator)

Example 14 with JMeterProperty

use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.

the class WhileController method getCondition.

/**
     * @return the condition
     */
public String getCondition() {
    JMeterProperty prop = getProperty(CONDITION);
    prop.recoverRunningVersion(this);
    return prop.getStringValue();
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty)

Example 15 with JMeterProperty

use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.

the class MultiPropertyConverter method unmarshal.

/** {@inheritDoc} */
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    MultiProperty prop = (MultiProperty) createCollection(context.getRequiredType());
    prop.setName(ConversionHelp.decode(reader.getAttribute(ConversionHelp.ATT_NAME)));
    while (reader.hasMoreChildren()) {
        reader.moveDown();
        JMeterProperty subProp = (JMeterProperty) readItem(reader, context, prop);
        if (subProp != null) {
            // could be null if it has been deleted via NameUpdater
            prop.addProperty(subProp);
        }
        reader.moveUp();
    }
    return prop;
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) MultiProperty(org.apache.jmeter.testelement.property.MultiProperty)

Aggregations

JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)87 StringProperty (org.apache.jmeter.testelement.property.StringProperty)23 Test (org.junit.Test)23 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)13 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)12 Argument (org.apache.jmeter.config.Argument)11 ArrayList (java.util.ArrayList)9 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)8 File (java.io.File)7 Arguments (org.apache.jmeter.config.Arguments)7 HTTPFileArg (org.apache.jmeter.protocol.http.util.HTTPFileArg)6 TestElement (org.apache.jmeter.testelement.TestElement)6 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)5 URL (java.net.URL)4 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 HashMap (java.util.HashMap)3 Sampler (org.apache.jmeter.samplers.Sampler)3 TestPlan (org.apache.jmeter.testelement.TestPlan)3 NullProperty (org.apache.jmeter.testelement.property.NullProperty)3