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"));
}
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));
}
Aggregations