Search in sources :

Example 6 with ConfigTestElement

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

the class LdapConfigGui method createTestElement.

/* Implements JMeterGUIComponent.createTestElement() */
@Override
public TestElement createTestElement() {
    ConfigTestElement element = new ConfigTestElement();
    modifyTestElement(element);
    return element;
}
Also used : ConfigTestElement(org.apache.jmeter.config.ConfigTestElement)

Example 7 with ConfigTestElement

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

the class LdapExtConfigGui method createTestElement.

/* Implements JMeterGUIComponent.createTestElement() */
@Override
public TestElement createTestElement() {
    ConfigTestElement element = new ConfigTestElement();
    modifyTestElement(element);
    return element;
}
Also used : ConfigTestElement(org.apache.jmeter.config.ConfigTestElement)

Example 8 with ConfigTestElement

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

the class TCPConfigGui method createTestElement.

@Override
public TestElement createTestElement() {
    ConfigTestElement element = new ConfigTestElement();
    modifyTestElement(element);
    return element;
}
Also used : ConfigTestElement(org.apache.jmeter.config.ConfigTestElement)

Example 9 with ConfigTestElement

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

the class PackageTest method testArguments.

@Test
public void testArguments() throws Exception {
    Arguments args = new Arguments();
    args.addArgument("arg1", "val1", "=");
    TestElementProperty prop = new TestElementProperty("args", args);
    ConfigTestElement te = new ConfigTestElement();
    te.addProperty(prop);
    te.setRunningVersion(true);
    Arguments config = new Arguments();
    config.addArgument("config1", "configValue", "=");
    TestElementProperty configProp = new TestElementProperty("args", config);
    ConfigTestElement te2 = new ConfigTestElement();
    te2.addProperty(configProp);
    te.addTestElement(te2);
    assertEquals(2, args.getArgumentCount());
    assertEquals("config1=configValue", args.getArgument(1).toString());
    te.recoverRunningVersion();
    te.addTestElement(te2);
    assertEquals(2, args.getArgumentCount());
    assertEquals("config1=configValue", args.getArgument(1).toString());
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) Arguments(org.apache.jmeter.config.Arguments) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) Test(org.junit.Test)

Example 10 with ConfigTestElement

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

the class TestTestCompiler method testConfigGathering.

@Test
public void testConfigGathering() throws Exception {
    ListedHashTree testing = new ListedHashTree();
    GenericController controller = new GenericController();
    ConfigTestElement config1 = new ConfigTestElement();
    config1.setName("config1");
    config1.setProperty("test.property", "A test value");
    TestSampler sampler = new TestSampler();
    sampler.setName("sampler");
    testing.add(controller, config1);
    testing.add(controller, sampler);
    TestCompiler.initialize();
    TestCompiler compiler = new TestCompiler(testing);
    testing.traverse(compiler);
    sampler = (TestSampler) compiler.configureSampler(sampler).getSampler();
    assertEquals("A test value", sampler.getPropertyAsString("test.property"));
}
Also used : ListedHashTree(org.apache.jorphan.collections.ListedHashTree) GenericController(org.apache.jmeter.control.GenericController) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) Test(org.junit.Test)

Aggregations

ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)22 TestElement (org.apache.jmeter.testelement.TestElement)7 Test (org.junit.Test)6 StringProperty (org.apache.jmeter.testelement.property.StringProperty)5 Arguments (org.apache.jmeter.config.Arguments)3 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)3 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)2 Collection (java.util.Collection)1 LinkedList (java.util.LinkedList)1 Assertion (org.apache.jmeter.assertions.Assertion)1 LoginConfig (org.apache.jmeter.config.LoginConfig)1 Controller (org.apache.jmeter.control.Controller)1 GenericController (org.apache.jmeter.control.GenericController)1 TransactionController (org.apache.jmeter.control.TransactionController)1 TransactionSampler (org.apache.jmeter.control.TransactionSampler)1 JMeterTreeNode (org.apache.jmeter.gui.tree.JMeterTreeNode)1 PostProcessor (org.apache.jmeter.processor.PostProcessor)1 PreProcessor (org.apache.jmeter.processor.PreProcessor)1 HttpDefaultsGui (org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui)1 Authorization (org.apache.jmeter.protocol.http.control.Authorization)1