use of org.apache.jmeter.protocol.http.sampler.HTTPSampler in project jmeter by apache.
the class TestSessionFilter method testIsFiltered.
@Test
public void testIsFiltered() throws Exception {
Map<String, CookieManager> cm = new ConcurrentHashMap<>();
Set<CookieManager> inUse = Collections.synchronizedSet(new HashSet<CookieManager>());
SessionFilter filter = new SessionFilter(cm, inUse);
HTTPSampler sampler = new HTTPSampler();
filter.isFiltered("1.2.3.4 ...", sampler);
assertSame(cm.get("1.2.3.4"), sampler.getCookieManager());
assertTrue(inUse.contains(sampler.getCookieManager()));
}
use of org.apache.jmeter.protocol.http.sampler.HTTPSampler in project jmeter by apache.
the class SessionFilter method isFiltered.
/**
* {@inheritDoc}
*/
@Override
public boolean isFiltered(String path, TestElement sampler) {
String ipAddr = getIpAddress(path);
CookieManager cm = getCookieManager(ipAddr);
((HTTPSampler) sampler).setCookieManager(cm);
return false;
}
Aggregations