Search in sources :

Example 61 with CompoundVariable

use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.

the class TestGroovyFunction method testSum.

@Test
public void testSum() throws Exception {
    params.add(new CompoundVariable("1+2+3"));
    function.setParameters(params);
    String ret = function.execute(result, null);
    assertEquals("6", ret);
}
Also used : CompoundVariable(org.apache.jmeter.engine.util.CompoundVariable) Test(org.junit.Test)

Example 62 with CompoundVariable

use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.

the class TestJavascriptFunction method testSum.

@Test
public void testSum() throws Exception {
    params.add(new CompoundVariable("1+2+3"));
    function.setParameters(params);
    String ret = function.execute(result, null);
    assertEquals("6", ret);
}
Also used : CompoundVariable(org.apache.jmeter.engine.util.CompoundVariable) Test(org.junit.Test)

Example 63 with CompoundVariable

use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.

the class TestJavascriptFunction method testSumVar.

@Test
public void testSumVar() throws Exception {
    params.add(new CompoundVariable("1+2+3"));
    params.add(new CompoundVariable("TOTAL"));
    function.setParameters(params);
    String ret = function.execute(result, null);
    assertEquals("6", ret);
    assertEquals("6", vars.get("TOTAL"));
}
Also used : CompoundVariable(org.apache.jmeter.engine.util.CompoundVariable) Test(org.junit.Test)

Example 64 with CompoundVariable

use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.

the class TestJexl2Function 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"));
}
Also used : CompoundVariable(org.apache.jmeter.engine.util.CompoundVariable) Test(org.junit.Test)

Example 65 with CompoundVariable

use of org.apache.jmeter.engine.util.CompoundVariable in project jmeter by apache.

the class TestJexl2Function method testSum.

@Test
public void testSum() throws Exception {
    params.add(new CompoundVariable("1+2+3"));
    function.setParameters(params);
    String ret = function.execute(result, null);
    assertEquals("6", ret);
}
Also used : CompoundVariable(org.apache.jmeter.engine.util.CompoundVariable) Test(org.junit.Test)

Aggregations

CompoundVariable (org.apache.jmeter.engine.util.CompoundVariable)103 Test (org.junit.Test)77 JMeterVariables (org.apache.jmeter.threads.JMeterVariables)16 LinkedList (java.util.LinkedList)9 JMeterContext (org.apache.jmeter.threads.JMeterContext)7 File (java.io.File)4 IOException (java.io.IOException)3 LocalDateTime (java.time.LocalDateTime)3 HashMap (java.util.HashMap)2 ReplaceStringWithFunctions (org.apache.jmeter.engine.util.ReplaceStringWithFunctions)2 InvalidVariableException (org.apache.jmeter.functions.InvalidVariableException)2 TestSampler (org.apache.jmeter.junit.stubs.TestSampler)2 JMeterProperty (org.apache.jmeter.testelement.property.JMeterProperty)2 StringProperty (org.apache.jmeter.testelement.property.StringProperty)2 JMeterStopThreadException (org.apache.jorphan.util.JMeterStopThreadException)2 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 DecimalFormat (java.text.DecimalFormat)1 LocalDate (java.time.LocalDate)1 ArrayList (java.util.ArrayList)1