1 | void testParseExample1() throws Exception {↵ | | 1 | void testNestedExample1() throws Exception {↵
|
2 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)↵ | | 2 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,"↵
|
3 | </html>,$1$)}");↵ | | 3 | + "$1$)}${__regexFunction(<html>(.*o)(.*o)(.*)" + "</html>,$1$$3$)}");↵
|
4 | JMeterProperty newProp = transformer.transformValue(prop);↵ | | 4 | JMeterProperty newProp = transformer.transformValue(prop);↵
|
5 | newProp.setRunningVersion(true);↵ | | 5 | newProp.setRunningVersion(true);↵
|
6 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵ | | 6 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵
|
7 | assertEquals("hello world", newProp.getStringValue());↵ | | 7 | assertEquals("hello worldhellorld", newProp.getStringValue());↵
|
8 | }↵ | | 8 | }↵
|
|
9 | public void testParseExample2() throws Exception {↵ | | 9 | public void testNestedExample2() throws Exception {↵
|
10 | StringProperty prop = new StringProperty("html", "It should say:\\${${__regexFunction(<html>(.*)</html>,$1$)}}");↵ | | 10 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,$1$)}");↵
|
11 | JMeterProperty newProp = transformer.transformValue(prop);↵ | | 11 | JMeterProperty newProp = transformer.transformValue(prop);↵
|
12 | newProp.setRunningVersion(true);↵ | | 12 | newProp.setRunningVersion(true);↵
|
13 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵ | | 13 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵
|
14 | assertEquals("It should say:${hello world}", newProp.getStringValue());↵ | | 14 | assertEquals("hello world", newProp.getStringValue());↵
|
15 | | | 15 |
|