use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class CSVReadFunctionTest method setCSVReadParams.
// Create the CSVRead function and set its parameters.
private static CSVRead setCSVReadParams(String p1, String p2) throws Exception {
CSVRead cr = new CSVRead();
Collection<CompoundVariable> parms = new LinkedList<>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
cr.setParameters(parms);
return cr;
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class PackageTest method setCSVReadParams.
// Create the CSVRead function and set its parameters.
private static CSVRead setCSVReadParams(String p1, String p2) throws Exception {
CSVRead cr = new CSVRead();
Collection<CompoundVariable> parms = new LinkedList<>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
cr.setParameters(parms);
return cr;
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class StringFromFileFunctionTest method SFFParams.
// Create the StringFromFile function and set its parameters.
private static StringFromFile SFFParams(String p1, String p2, String p3, String p4) throws Exception {
StringFromFile sff = new StringFromFile();
Collection<CompoundVariable> parms = new LinkedList<>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
if (p2 != null) {
parms.add(new CompoundVariable(p2));
}
if (p3 != null) {
parms.add(new CompoundVariable(p3));
}
if (p4 != null) {
parms.add(new CompoundVariable(p4));
}
sff.setParameters(parms);
return sff;
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class SumFunctionTest method checkSum.
// Perform a sum and check the results
private void checkSum(AbstractFunction func, String value, String[] addends) throws Exception {
Collection<CompoundVariable> parms = new LinkedList<>();
for (String addend : addends) {
parms.add(new CompoundVariable(addend));
}
parms.add(new CompoundVariable("Result"));
func.setParameters(parms);
assertEquals(value, func.execute(null, null));
assertEquals(value, vars.getObject("Result"));
}
use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.
the class TestGroovyFunction 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"));
}
Aggregations