Search in sources :

Example 11 with Arguments

use of org.apache.jmeter.config.Arguments in project jmeter by apache.

the class InfluxDBRawBackendListenerClient method getDefaultParameters.

@Override
public Arguments getDefaultParameters() {
    Arguments arguments = new Arguments();
    DEFAULT_ARGS.forEach(arguments::addArgument);
    return arguments;
}
Also used : Arguments(org.apache.jmeter.config.Arguments)

Example 12 with Arguments

use of org.apache.jmeter.config.Arguments 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 Arguments

use of org.apache.jmeter.config.Arguments in project jmeter by apache.

the class TestSave method testTreeConversion.

@Test
public void testTreeConversion() throws Exception {
    HashTree tree = new ListedHashTree();
    JMeterTreeNode root = new JMeterTreeNode(new Arguments(), null);
    tree.add(root, root);
    tree.getTree(root).add(root, root);
    save.convertSubTree(tree);
    assertEquals(tree.getArray()[0].getClass().getName(), root.getTestElement().getClass().getName());
    tree = tree.getTree(tree.getArray()[0]);
    assertEquals(tree.getArray()[0].getClass().getName(), root.getTestElement().getClass().getName());
    assertEquals(tree.getTree(tree.getArray()[0]).getArray()[0].getClass().getName(), root.getTestElement().getClass().getName());
}
Also used : ListedHashTree(org.apache.jorphan.collections.ListedHashTree) HashTree(org.apache.jorphan.collections.HashTree) ListedHashTree(org.apache.jorphan.collections.ListedHashTree) Arguments(org.apache.jmeter.config.Arguments) JMeterTreeNode(org.apache.jmeter.gui.tree.JMeterTreeNode) Test(org.junit.jupiter.api.Test)

Example 14 with Arguments

use of org.apache.jmeter.config.Arguments in project jmeter by apache.

the class TestArgumentsPanel method testArgumentCreation.

/**
 * Test that adding an argument to the table results in an appropriate
 * TestElement being created.
 */
@Test
public void testArgumentCreation() throws Exception {
    ArgumentsPanel gui = new ArgumentsPanel();
    gui.tableModel.addRow(new Argument());
    gui.tableModel.setValueAt("howdy", 0, 0);
    gui.tableModel.addRow(new Argument());
    gui.tableModel.setValueAt("doody", 0, 1);
    assertEquals("=", ((Argument) ((Arguments) gui.createTestElement()).getArguments().get(0).getObjectValue()).getMetaData());
}
Also used : Argument(org.apache.jmeter.config.Argument) Arguments(org.apache.jmeter.config.Arguments) Test(org.junit.jupiter.api.Test)

Example 15 with Arguments

use of org.apache.jmeter.config.Arguments in project jmeter by apache.

the class TestPlan method getVariables.

private Arguments getVariables() {
    Arguments args = (Arguments) getProperty(USER_DEFINED_VARIABLES).getObjectValue();
    if (args == null) {
        args = new Arguments();
        setUserDefinedVariables(args);
    }
    return args;
}
Also used : Arguments(org.apache.jmeter.config.Arguments)

Aggregations

Arguments (org.apache.jmeter.config.Arguments)96 Test (org.junit.jupiter.api.Test)32 HTTPSamplerBase (org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)18 SampleResult (org.apache.jmeter.samplers.SampleResult)17 Argument (org.apache.jmeter.config.Argument)15 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)10 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)8 HTTPFileArg (org.apache.jmeter.protocol.http.util.HTTPFileArg)7 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)7 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)6 TestElement (org.apache.jmeter.testelement.TestElement)6 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)5 Test (org.junit.Test)5 HTTPFileArgs (org.apache.jmeter.protocol.http.util.HTTPFileArgs)4 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)4 IOException (java.io.IOException)3 URL (java.net.URL)3 Iterator (java.util.Iterator)3 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)3 CollectionProperty (org.apache.jmeter.testelement.property.CollectionProperty)3