Search in sources :

Example 21 with ConfigTestElement

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

the class PackageTest method testRecovery.

@Test
public void testRecovery() throws Exception {
    ConfigTestElement config = new ConfigTestElement();
    config.addProperty(new StringProperty("name", "config"));
    config.setRunningVersion(true);
    LoginConfig loginConfig = new LoginConfig();
    loginConfig.setUsername("user1");
    loginConfig.setPassword("pass1");
    assertTrue(config.getProperty("login") instanceof NullProperty);
    // This test should work whether or not all Nulls are equal
    assertEquals(new NullProperty("login"), config.getProperty("login"));
    config.addProperty(new TestElementProperty("login", loginConfig));
    assertEquals(loginConfig.toString(), config.getPropertyAsString("login"));
    config.recoverRunningVersion();
    assertTrue(config.getProperty("login") instanceof NullProperty);
    assertEquals(new NullProperty("login"), config.getProperty("login"));
}
Also used : NullProperty(org.apache.jmeter.testelement.property.NullProperty) TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) LoginConfig(org.apache.jmeter.config.LoginConfig) StringProperty(org.apache.jmeter.testelement.property.StringProperty) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) Test(org.junit.Test)

Example 22 with ConfigTestElement

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

the class SimpleConfigGui method createTestElement.

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

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