use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.
the class PackageTest method testParseExample9.
@Test
public void testParseExample9() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(([$]\\d+\\.\\d+),$1$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("$3.47", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.
the class PackageTest method testParseExample13.
// Escaped dollar commma and backslash with missing variable reference
@Test
public void testParseExample13() throws Exception {
StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${missing} \\$b \\, \\\\ cd");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
// N.B. Backslashes are removed before dollar, comma and backslash
assertEquals("$a , \\ \\x \\ ${missing} $b , \\ cd", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.
the class PackageTest method testParseExample8.
@Test
public void testParseExample8() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction((\\\\$\\d+\\.\\d+),$1$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("$3.47", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.
the class PackageTest method testParseExample4.
@Test
public void testParseExample4() throws Exception {
StringProperty prop = new StringProperty("html", "${non-existing function}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("${non-existing function}", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.JMeterProperty in project jmeter by apache.
the class PackageTest method testNestedExample2.
@Test
public void testNestedExample2() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,$1$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("hello world", newProp.getStringValue());
}
Aggregations