Search in sources :

Example 1 with HTTPNullSampler

use of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler in project jmeter by apache.

the class UrlConfigTest method setUp.

@BeforeEach
public void setUp() {
    Arguments args = new Arguments();
    args.addArgument("username", "mstover");
    args.addArgument("password", "pass");
    args.addArgument("action", "login");
    config = new HTTPNullSampler();
    config.setName("Full Config");
    config.setProperty(HTTPSamplerBase.DOMAIN, "www.lazer.com");
    config.setProperty(HTTPSamplerBase.PATH, "login.jsp");
    config.setProperty(HTTPSamplerBase.METHOD, HTTPConstants.POST);
    config.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));
    defaultConfig = new HTTPNullSampler();
    defaultConfig.setName("default");
    defaultConfig.setProperty(HTTPSamplerBase.DOMAIN, "www.xerox.com");
    defaultConfig.setProperty(HTTPSamplerBase.PATH, "default.html");
    partialConfig = new HTTPNullSampler();
    partialConfig.setProperty(HTTPSamplerBase.PATH, "main.jsp");
    partialConfig.setProperty(HTTPSamplerBase.METHOD, HTTPConstants.GET);
}
Also used : HTTPNullSampler(org.apache.jmeter.protocol.http.sampler.HTTPNullSampler) TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) Arguments(org.apache.jmeter.config.Arguments) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with HTTPNullSampler

use of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler in project jmeter by apache.

the class TestURLRewritingModifier method createSampler.

private HTTPSamplerBase createSampler() {
    HTTPSamplerBase sampler = new HTTPNullSampler();
    sampler.setDomain("server.com");
    sampler.setPath("index.html");
    sampler.setMethod(HTTPConstants.GET);
    sampler.setProtocol("http");
    return sampler;
}
Also used : HTTPNullSampler(org.apache.jmeter.protocol.http.sampler.HTTPNullSampler) HTTPSamplerBase(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)

Example 3 with HTTPNullSampler

use of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler 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()));
}
Also used : BasicClientCookie(org.apache.http.impl.cookie.BasicClientCookie) ClientCookie(org.apache.http.cookie.ClientCookie) HTTPNullSampler(org.apache.jmeter.protocol.http.sampler.HTTPNullSampler) HTTPSamplerBase(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase) Test(org.junit.jupiter.api.Test)

Example 4 with HTTPNullSampler

use of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler in project jmeter by apache.

the class TestAnchorModifier method makeContext.

private HTTPSamplerBase makeContext(String url) throws MalformedURLException {
    URL u = new URL(url);
    HTTPSamplerBase context = new HTTPNullSampler();
    context.setDomain(u.getHost());
    context.setPath(u.getPath());
    context.setPort(u.getPort());
    context.setProtocol(u.getProtocol());
    context.parseArguments(u.getQuery());
    return context;
}
Also used : HTTPNullSampler(org.apache.jmeter.protocol.http.sampler.HTTPNullSampler) URL(java.net.URL) HTTPSamplerBase(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)

Example 5 with HTTPNullSampler

use of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler in project jmeter by apache.

the class TestAnchorModifier method makeUrlConfig.

private HTTPSamplerBase makeUrlConfig(String path) {
    HTTPSamplerBase config = new HTTPNullSampler();
    config.setDomain("www.apache.org");
    config.setMethod(HTTPConstants.GET);
    config.setPath(path);
    config.setPort(HTTPConstants.DEFAULT_HTTP_PORT);
    config.setProtocol(HTTPConstants.PROTOCOL_HTTP);
    return config;
}
Also used : HTTPNullSampler(org.apache.jmeter.protocol.http.sampler.HTTPNullSampler) HTTPSamplerBase(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)

Aggregations

HTTPNullSampler (org.apache.jmeter.protocol.http.sampler.HTTPNullSampler)8 HTTPSamplerBase (org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase)6 Test (org.junit.jupiter.api.Test)3 ClientCookie (org.apache.http.cookie.ClientCookie)2 BasicClientCookie (org.apache.http.impl.cookie.BasicClientCookie)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 URL (java.net.URL)1 Arguments (org.apache.jmeter.config.Arguments)1 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)1