Search in sources :

Example 21 with TestElementProperty

use of org.apache.jmeter.testelement.property.TestElementProperty 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 TestElementProperty

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

the class AbstractThreadGroup method setSamplerController.

/**
     * Set the sampler controller.
     *
     * @param c
     *            the sampler controller.
     */
public void setSamplerController(LoopController c) {
    c.setContinueForever(false);
    setProperty(new TestElementProperty(MAIN_CONTROLLER, c));
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty)

Aggregations

TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)22 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)5 TestElement (org.apache.jmeter.testelement.TestElement)4 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)4 Arguments (org.apache.jmeter.config.Arguments)3 NullProperty (org.apache.jmeter.testelement.property.NullProperty)3 StringProperty (org.apache.jmeter.testelement.property.StringProperty)3 HeaderManager (org.apache.jmeter.protocol.http.control.HeaderManager)2 BooleanProperty (org.apache.jmeter.testelement.property.BooleanProperty)2 PropertyIterator (org.apache.jmeter.testelement.property.PropertyIterator)2 Test (org.junit.Test)2 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 LoginConfig (org.apache.jmeter.config.LoginConfig)1 AuthManager (org.apache.jmeter.protocol.http.control.AuthManager)1 Authorization (org.apache.jmeter.protocol.http.control.Authorization)1 DNSCacheManager (org.apache.jmeter.protocol.http.control.DNSCacheManager)1 Header (org.apache.jmeter.protocol.http.control.Header)1 HTTPNullSampler (org.apache.jmeter.protocol.http.sampler.HTTPNullSampler)1 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)1