use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testNestedExample1.
@Test
public void testNestedExample1() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>," + "$1$)}${__regexFunction(<html>(.*o)(.*o)(.*)" + "</html>,$1$$3$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("hello worldhellorld", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample12.
// N.B. See Bug 46831 which wanted to changed the behaviour of \$
// It's too late now, as this would invalidate some existing test plans,
// so document the current behaviour with some more tests.
// Escaped dollar commma and backslash with variable reference
@Test
public void testParseExample12() throws Exception {
StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${server} \\$b \\, \\\\ cd");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
// N.B. Backslashes are removed before dollar, comma and backslash
assertEquals("$a , \\ \\x \\ jakarta.apache.org $b , \\ cd", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample5.
@Test
public void testParseExample5() throws Exception {
StringProperty prop = new StringProperty("html", "");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.StringProperty", newProp.getClass().getName());
assertEquals("", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class SimpleConfigGui method modifyTestElement.
/**
* Get all of the values from the GUI component and set them in the
* TestElement.
*
* @param el
* the TestElement to modify
*/
@Override
public void modifyTestElement(TestElement el) {
GuiUtils.stopTableEditing(table);
Data model = tableModel.getData();
model.reset();
while (model.next()) {
el.setProperty(new StringProperty((String) model.getColumnValue(COLUMN_NAMES_0), (String) model.getColumnValue(COLUMN_NAMES_1)));
}
super.configureTestElement(el);
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class AbstractThreadGroupGui method configureTestElement.
@Override
protected void configureTestElement(TestElement tg) {
super.configureTestElement(tg);
tg.setProperty(new StringProperty(AbstractThreadGroup.ON_SAMPLE_ERROR, onSampleError()));
}
Aggregations