org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy Java Examples

The following examples show how to use org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JmxBinaryBodyBuilder.java    From postman2jmx with MIT License 6 votes vote down vote up
@Override
public HTTPSamplerProxy buildJmxBody(PostmanItem postmanItem)  {
    HTTPSamplerProxy httpSamplerProxy = JmxHTTPSamplerProxy.newInstance(postmanItem);
    PostmanFileBody fileBody = postmanItem.getRequest().getBody().getFile();

    HTTPFileArg argument = new HTTPFileArg();
    argument.setPath(fileBody.getSrc() == null ? "" : fileBody.getSrc());
    argument.setParamName(" ");
    argument.setMimeType(" ");

    HTTPFileArg[] fileArgs = new HTTPFileArg[1];
    fileArgs[0] = argument;

    httpSamplerProxy.setHTTPFiles(fileArgs);

    return httpSamplerProxy;
}
 
Example #2
Source File: JmxRawBodyBuilder.java    From postman2jmx with MIT License 6 votes vote down vote up
@Override
public HTTPSamplerProxy buildJmxBody(PostmanItem postmanItem)  {

    HTTPSamplerProxy httpSamplerProxy = JmxHTTPSamplerProxy.newInstance(postmanItem);

    if ("post".equalsIgnoreCase(httpSamplerProxy.getMethod())) {
        httpSamplerProxy.setPostBodyRaw(true);
        Arguments arguments = new Arguments();
        PostmanRawBody raw = postmanItem.getRequest().getBody().getRaw();

        if (raw.getValue() != null && !raw.getValue().isEmpty()) {
            HTTPArgument argument = new HTTPArgument();
            argument.setEnabled(true);
            argument.setAlwaysEncoded(false);
            argument.setMetaData("=");
            argument.setValue(raw.getValue());
            arguments.addArgument(argument);
        }
        httpSamplerProxy.setArguments(arguments);
    }

    return httpSamplerProxy;
}
 
Example #3
Source File: AbstractJmxBodyBuilder.java    From postman2jmx with MIT License 4 votes vote down vote up
@Override
public HTTPSamplerProxy buildJmxBody(PostmanItem postmanItem) throws Exception {
    return JmxHTTPSamplerProxy.newInstance(postmanItem);
}
 
Example #4
Source File: JmxEmptyBodyBuilder.java    From postman2jmx with MIT License 4 votes vote down vote up
@Override
public HTTPSamplerProxy buildJmxBody(PostmanItem postmanItem) throws Exception {
    return JmxHTTPSamplerProxy.newInstance(postmanItem);
}
 
Example #5
Source File: JMeterElements.java    From teammates with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns a HTTP Request element with a GET method to the endpoint specified by {@code path}.
 */
public static HTTPSamplerProxy httpGetSampler(String path) {
    return httpSampler(path, HttpGet.METHOD_NAME, null);
}
 
Example #6
Source File: IJmxBodyBuilder.java    From postman2jmx with MIT License votes vote down vote up
HTTPSamplerProxy buildJmxBody(PostmanItem postmanItem) throws Exception;