use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.
the class DurationAssertionTest method setUp.
@Before
public void setUp() {
JMeterContext jmctx = JMeterContextService.getContext();
assertion = new DurationAssertion();
assertion.setThreadContext(jmctx);
JMeterVariables vars = new JMeterVariables();
jmctx.setVariables(vars);
sampleResult = new SampleResult();
sampleResult.setResponseData(data, null);
}
use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.
the class ResponseAssertionTest method setUp.
@Before
public void setUp() throws MalformedURLException {
JMeterContext jmctx = JMeterContextService.getContext();
assertion = new ResponseAssertion();
assertion.setThreadContext(jmctx);
sample = new SampleResult();
JMeterVariables vars = new JMeterVariables();
jmctx.setVariables(vars);
jmctx.setPreviousResult(sample);
sample.setResponseData("response Data\nline 2\n\nEOF", null);
sample.setURL(new URL("http://localhost/Sampler/Data/"));
sample.setResponseCode("401");
sample.setResponseHeaders("X-Header: abcd");
sample.setRequestHeaders("X-reqHeader: cdef");
}
use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.
the class SizeAssertionTest method setUp.
@Before
public void setUp() {
JMeterContext jmctx = JMeterContextService.getContext();
assertion = new SizeAssertion();
assertion.setThreadContext(jmctx);
assertion.setTestFieldResponseBody();
JMeterVariables vars = new JMeterVariables();
jmctx.setVariables(vars);
sample0 = new SampleResult();
sample1 = new SampleResult();
sample1.setResponseData(data1, null);
}
use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.
the class TestRandomVariableConfig method setUp.
@Before
public void setUp() {
JMeterContext jmcx = JMeterContextService.getContext();
jmcx.setVariables(new JMeterVariables());
threadVars = jmcx.getVariables();
config.setRandomSeed("abcd");
config.setVariableName("randomVar");
}
use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.
the class XPathAssertionTest method setUp.
@Before
public void setUp() throws Exception {
jmctx = JMeterContextService.getContext();
assertion = new XPathAssertion();
// This would be done by the run command
assertion.setThreadContext(jmctx);
result = new SampleResult();
result.setResponseData(readFile("testfiles/XPathAssertionTest.xml"));
vars = new JMeterVariables();
jmctx.setVariables(vars);
jmctx.setPreviousResult(result);
}
Aggregations