use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestJavascriptFunction method testReplace1.
@Test
public void testReplace1() throws Exception {
params.add(new CompoundVariable("sampleResult.getResponseDataAsString().replaceAll('T','t')"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals("the quick brown fox", ret);
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestJavascriptFunction method testReplace2.
@Test
public void testReplace2() throws Exception {
vars.put("URL", "/query.cgi?s1=1&s2=2&s3=3");
params.add(new CompoundVariable("vars.get('URL').replaceAll('&','&')"));
params.add(new CompoundVariable("URL"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals("/query.cgi?s1=1&s2=2&s3=3", ret);
assertEquals(ret, vars.getObject("URL"));
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestJexl2Function method testReplace1.
@Test
public void testReplace1() throws Exception {
params.add(new CompoundVariable("sampleResult.getResponseDataAsString().replaceAll('T','t')"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals("the quick brown fox", ret);
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestSetProperty method testSetPropertyNoReturn.
@Test
public void testSetPropertyNoReturn() throws Exception {
params.add(new CompoundVariable("prop1"));
params.add(new CompoundVariable("value1"));
function.setParameters(params);
String returnValue = function.execute(result, null);
assertEquals("value1", JMeterUtils.getProperty("prop1"));
assertEquals("", returnValue);
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestMachineIPName method testMachineNameWithVar.
@Test
public void testMachineNameWithVar() throws Exception {
function = new MachineName();
params.add(new CompoundVariable("HOST_NAME"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals(JMeterUtils.getLocalHostName(), ret);
assertEquals(JMeterUtils.getLocalHostName(), vars.get("HOST_NAME"));
}
Aggregations