use of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase in project jmeter by apache.
the class TestURLRewritingModifier method testGrabSessionId3.
@Test
public void testGrabSessionId3() throws Exception {
String html = "href='index.html?session_id=jfdkjdkfjddkfdfjkdjfdf'";
response = new SampleResult();
response.setResponseData(html, null);
mod.setArgumentName("session_id");
HTTPSamplerBase sampler = createSampler();
context.setCurrentSampler(sampler);
context.setPreviousResult(response);
mod.process();
Arguments args = sampler.getArguments();
assertEquals("jfdkjdkfjddkfdfjkdjfdf", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
}
use of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase in project jmeter by apache.
the class TestURLRewritingModifier method testGrabSessionIdFromXMLNonPatExtension.
@Test
public void testGrabSessionIdFromXMLNonPatExtension() throws Exception {
// Bug 50286
String html = "<url>/some/path;jsessionid=123456789</url>";
response = new SampleResult();
response.setResponseData(html, null);
mod.setArgumentName("jsessionid");
HTTPSamplerBase sampler = createSampler();
context.setCurrentSampler(sampler);
context.setPreviousResult(response);
mod.process();
Arguments args = sampler.getArguments();
assertEquals("123456789", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
}
use of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase in project jmeter by apache.
the class TestURLRewritingModifier method testGrabSessionId2.
@Test
public void testGrabSessionId2() throws Exception {
String html = "<a href=\"http://server.com/index.html?" + "session_id=jfdkjdkfjddkfdfjkdjfdf\">";
response = new SampleResult();
response.setResponseData(html, null);
mod.setArgumentName("session_id");
HTTPSamplerBase sampler = createSampler();
context.setCurrentSampler(sampler);
context.setPreviousResult(response);
mod.process();
Arguments args = sampler.getArguments();
assertEquals("jfdkjdkfjddkfdfjkdjfdf", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
}
use of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase in project jmeter by apache.
the class TestURLRewritingModifier method testBug61314.
@Test
public void testBug61314() throws Exception {
// Bug 50286
String html = "<url>/some/path;jsessionid=123456789</url>";
response = new SampleResult();
response.setResponseData(html, null);
mod.setArgumentName("jsessionid");
mod.setPathExtension(true);
HTTPSamplerBase sampler = createSampler();
sampler.setPath("/urlRewrite/index;jsessionid=657CF77A86183868CF30AC36321394B7");
context.setCurrentSampler(sampler);
context.setPreviousResult(response);
mod.process();
assertEquals("/urlRewrite/index;jsessionid=123456789", sampler.getPath());
}
use of org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase in project jmeter by apache.
the class TestHC4CookieManager method testSendCookie.
@Test
public void testSendCookie() throws Exception {
man.add(new Cookie("id", "value", "jakarta.apache.org", "/", false, 9999999999L));
HTTPSamplerBase sampler = new HTTPNullSampler();
sampler.setDomain("jakarta.apache.org");
sampler.setPath("/index.html");
sampler.setMethod(HTTPConstants.GET);
assertNotNull(man.getCookieHeaderForURL(sampler.getUrl()));
}
Aggregations