Search in sources :

Example 6 with Arguments

use of org.apache.jmeter.config.Arguments in project jmeter-plugins by undera.

the class ParameterizedControllerGuiTest method testConfigure.

@Test
public void testConfigure() {
    System.out.println("configure");
    ParameterizedController te = new ParameterizedController();
    te.setUserDefinedVariables(new Arguments());
    te.setName("test");
    te.setComment("test");
    instance.configure(te);
}
Also used : Arguments(org.apache.jmeter.config.Arguments) Test(org.junit.Test)

Example 7 with Arguments

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

the class GraphiteBackendListenerClient method getDefaultParameters.

@Override
public Arguments getDefaultParameters() {
    Arguments arguments = new Arguments();
    arguments.addArgument(GRAPHITE_METRICS_SENDER, TextGraphiteMetricsSender.class.getName());
    arguments.addArgument(GRAPHITE_HOST, "");
    arguments.addArgument(GRAPHITE_PORT, Integer.toString(DEFAULT_PLAINTEXT_PROTOCOL_PORT));
    arguments.addArgument(ROOT_METRICS_PREFIX, DEFAULT_METRICS_PREFIX);
    arguments.addArgument(SUMMARY_ONLY, "true");
    arguments.addArgument(SAMPLERS_LIST, "");
    arguments.addArgument(USE_REGEXP_FOR_SAMPLERS_LIST, USE_REGEXP_FOR_SAMPLERS_LIST_DEFAULT);
    arguments.addArgument(PERCENTILES, DEFAULT_PERCENTILES);
    return arguments;
}
Also used : Arguments(org.apache.jmeter.config.Arguments)

Example 8 with Arguments

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

the class InfluxdbBackendListenerClient 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 9 with Arguments

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

the class BackendListenerGui method actionPerformed.

/**
 * Handle action events for this component. This method currently handles
 * events for the classname combo box.
 *
 * @param event
 *            the ActionEvent to be handled
 */
@Override
public void actionPerformed(ActionEvent event) {
    if (event.getSource() == classnameCombo) {
        String newClassName = ((String) classnameCombo.getSelectedItem()).trim();
        try {
            BackendListenerClient client = createBackendListenerClient(newClassName);
            BackendListenerClient oldClient = createBackendListenerClient(className);
            Arguments currArgs = new Arguments();
            argsPanel.modifyTestElement(currArgs);
            Map<String, String> currArgsMap = currArgs.getArgumentsAsMap();
            Map<String, String> userArgMap = new HashMap<>();
            userArgMap.putAll(currArgsMap);
            Arguments defaultArgs = extractDefaultArguments(client, userArgMap, oldClient.getDefaultParameters());
            Arguments newArgs = copyDefaultArguments(currArgsMap, defaultArgs);
            userArgMap.forEach(newArgs::addArgument);
            className = newClassName;
            argsPanel.configure(newArgs);
        } catch (Exception e) {
            log.error("Error getting argument list for {}", newClassName, e);
        }
    }
}
Also used : HashMap(java.util.HashMap) Arguments(org.apache.jmeter.config.Arguments)

Example 10 with Arguments

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

the class BackendListenerGui method copyDefaultArguments.

private Arguments copyDefaultArguments(Map<String, String> currArgsMap, Arguments defaultArgs) {
    Arguments newArgs = new Arguments();
    if (defaultArgs != null) {
        for (JMeterProperty jMeterProperty : defaultArgs.getArguments()) {
            Argument arg = (Argument) jMeterProperty.getObjectValue();
            String name = arg.getName();
            String value = arg.getValue();
            // values that they did in the original test.
            if (currArgsMap.containsKey(name)) {
                String newVal = currArgsMap.get(name);
                if (StringUtils.isNotBlank(newVal)) {
                    value = newVal;
                }
            }
            newArgs.addArgument(name, value);
        }
    }
    return newArgs;
}
Also used : JMeterProperty(org.apache.jmeter.testelement.property.JMeterProperty) Argument(org.apache.jmeter.config.Argument) 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