Search in sources :

Example 51 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class TestTimeShiftFunction method setUp.

@Before
public void setUp() {
    jmctx = JMeterContextService.getContext();
    vars = new JMeterVariables();
    jmctx.setVariables(vars);
    jmctx.setPreviousResult(result);
    result = new SampleResult();
    function = new TimeShift();
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) SampleResult(org.apache.jmeter.samplers.SampleResult) Before(org.junit.Before)

Example 52 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class VariableTest method setUp.

@Before
public void setUp() {
    jmctx = JMeterContextService.getContext();
    jmctx.setVariables(new JMeterVariables());
    vars = jmctx.getVariables();
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) Before(org.junit.Before)

Example 53 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class TestRegexFunction method setUp.

@Before
public void setUp() {
    variable = new RegexFunction();
    result = new SampleResult();
    jmctx = JMeterContextService.getContext();
    String data = "<company-xmlext-query-ret><row>" + "<value field=\"RetCode\">" + "LIS_OK</value><value" + " field=\"RetCodeExtension\"></value>" + "<value field=\"alias\"></value><value" + " field=\"positioncount\"></value>" + "<value field=\"invalidpincount\">0</value><value" + " field=\"pinposition1\">1</value><value" + " field=\"pinpositionvalue1\"></value><value" + " field=\"pinposition2\">5</value><value" + " field=\"pinpositionvalue2\"></value><value" + " field=\"pinposition3\">6</value><value" + " field=\"pinpositionvalue3\"></value>" + "</row></company-xmlext-query-ret>";
    result.setResponseData(data, null);
    vars = new JMeterVariables();
    String data2 = "The quick brown fox jumped over the lazy dog 123 times";
    vars.put(INPUT_VARIABLE_NAME, data2);
    jmctx.setVariables(vars);
    jmctx.setPreviousResult(result);
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) SampleResult(org.apache.jmeter.samplers.SampleResult) Before(org.junit.Before)

Example 54 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class TestSamplerNameFunction method setUp.

@Before
public void setUp() {
    jmctx = JMeterContextService.getContext();
    vars = new JMeterVariables();
    jmctx.setVariables(vars);
    jmctx.setPreviousResult(result);
    params = new LinkedList<>();
    result = new SampleResult();
    variable = new SamplerName();
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) SampleResult(org.apache.jmeter.samplers.SampleResult) Before(org.junit.Before)

Example 55 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class TestJavascriptFunction method setUp.

@Before
public void setUp() {
    function = new JavaScript();
    result = new SampleResult();
    jmctx = JMeterContextService.getContext();
    String data = "The quick brown fox";
    result.setResponseData(data, null);
    vars = new JMeterVariables();
    jmctx.setVariables(vars);
    jmctx.setPreviousResult(result);
    params = new LinkedList<>();
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) SampleResult(org.apache.jmeter.samplers.SampleResult) Before(org.junit.Before)

Aggregations

JMeterVariables (org.apache.jmeter.threads.JMeterVariables)96 SampleResult (org.apache.jmeter.samplers.SampleResult)35 JMeterContext (org.apache.jmeter.threads.JMeterContext)33 Before (org.junit.Before)33 CompoundVariable (org.apache.jmeter.engine.util.CompoundVariable)17 Test (org.junit.Test)16 JSONPostProcessor (org.apache.jmeter.extractor.json.jsonpath.JSONPostProcessor)8 TestPlan (org.apache.jmeter.testelement.TestPlan)6 HashMap (java.util.HashMap)5 Sampler (org.apache.jmeter.samplers.Sampler)5 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 ValueReplacer (org.apache.jmeter.engine.util.ValueReplacer)4 Properties (java.util.Properties)3 TestSampler (org.apache.jmeter.junit.stubs.TestSampler)3 Logger (org.slf4j.Logger)3 URL (java.net.URL)2 Arguments (org.apache.jmeter.config.Arguments)2 ReplaceStringWithFunctions (org.apache.jmeter.engine.util.ReplaceStringWithFunctions)2 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)2