use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample7.
@Test
public void testParseExample7() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(\\<([a-z]*)\\>,$1$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("html", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample1.
@Test
public void testParseExample1() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</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());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample6.
@Test
public void testParseExample6() throws Exception {
StringProperty prop = new StringProperty("html", "${server}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("jakarta.apache.org", newProp.getStringValue());
}
use of org.apache.jmeter.testelement.property.StringProperty in project jmeter by apache.
the class PackageTest method testParseExample3.
@Test
public void testParseExample3() throws Exception {
StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</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 testParseExample2.
@Test
public void testParseExample2() throws Exception {
StringProperty prop = new StringProperty("html", "It should say:\\${${__regexFunction(<html>(.*)</html>,$1$)}}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("It should say:${hello world}", newProp.getStringValue());
}
Aggregations