Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.blazemeter.jmeter.http2.sampler;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.engine.event.LoopIterationEvent;
import org.apache.jmeter.engine.event.LoopIterationListener;
import org.apache.jmeter.protocol.http.control.CacheManager;
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.HeaderManager;
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
import org.apache.jmeter.protocol.http.util.HTTPArgument;
import org.apache.jmeter.protocol.http.util.HTTPConstants;
import org.apache.jmeter.protocol.http.util.HTTPFileArg;
import org.apache.jmeter.protocol.http.util.HTTPFileArgs;
import org.apache.jmeter.samplers.AbstractSampler;
import org.apache.jmeter.samplers.Entry;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.ThreadListener;
import org.apache.jmeter.testelement.property.JMeterProperty;
import org.apache.jmeter.testelement.property.StringProperty;
import org.apache.jmeter.testelement.property.TestElementProperty;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
import org.eclipse.jetty.http.HttpFields;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
public class HTTP2Request extends AbstractSampler implements ThreadListener, LoopIterationListener {
private static final long serialVersionUID = 5859387434748163229L;
private static final Logger log = LoggingManager.getLoggerForClass();
private static final String DEFAULT_RESPONSE_TIMEOUT = "20000"; //20 sec
public static final String METHOD = "HTTP2Sampler.method";
private static final String PROTOCOL_SCHEME = "HTTP2Sampler.scheme";
public static final String PORT = "HTTPSampler.port"; // $NON-NLS-1$
private static final String FILE_ARGS = "HTTPsampler.Files"; // $NON-NLS-1$
public static final String DEFAULT_METHOD = "GET";
private static final String HEADER_MANAGER = "HTTP2Request.header_manager"; // $NON-NLS-1$
private static final String COOKIE_MANAGER = "HTTP2Request.cookie_manager"; // $NON-NLS-1$
private static final String CACHE_MANAGER = "HTTP2Request.cache_manager"; // $NON-NLS-1$
private static final String HTTP_PREFIX = HTTPConstants.PROTOCOL_HTTP + "://"; // $NON-NLS-1$
private static final String HTTPS_PREFIX = HTTPConstants.PROTOCOL_HTTPS + "://"; // $NON-NLS-1$
private static final String DEFAULT_PROTOCOL = HTTPConstants.PROTOCOL_HTTPS;
/**
* A number to indicate that the port has not been set.
*/
private static final int UNSPECIFIED_PORT = 0;
public static final String UNSPECIFIED_PORT_AS_STRING = "0"; // $NON-NLS-1$
private static final String NON_HTTP_RESPONSE_CODE = "Non HTTP response code";
private static final String NON_HTTP_RESPONSE_MESSAGE = "Non HTTP response message";
public static final String IP_SOURCE = "HTTP2Request.ipSource"; // $NON-NLS-1$
public static final String IP_SOURCE_TYPE = "HTTP2Request.ipSourceType"; // $NON-NLS-1$
// Embedded URLs must match this regex (if provided)
public static final String EMBEDDED_URL_REGEX = "HTTPSampler.embedded_url_re"; // $NON-NLS-1$
// Store MD5 hash instead of storing response
public static final String MD5 = "HTTPSampler.md5"; // $NON-NLS-1$
public static final String EMBEDDED_RESOURCES = "HTTPSampler.embedded_resources"; // $NON-NLS-1$
public static final int SOURCE_TYPE_DEFAULT = HTTPSamplerBase.SourceType.HOSTNAME.ordinal();
public static final String ARGUMENTS = "HTTP2Request.Arguments"; // $NON-NLS-1$
public static final String POST_BODY_RAW = "HTTP2Request.postBodyRaw"; // TODO - belongs elsewhere
public static final boolean POST_BODY_RAW_DEFAULT = false;
public static final String DOMAIN = "HTTP2Request.domain"; // $NON-NLS-1$
public static final String RESPONSE_TIMEOUT = "HTTP2Request.response_timeout"; // $NON-NLS-1$
public static final String FOLLOW_REDIRECTS = "HTTP2Request.follow_redirects"; // $NON-NLS-1$
public static final String AUTO_REDIRECTS = "HTTP2Request.auto_redirects"; // $NON-NLS-1$
public static final String SYNC_REQUEST = "HTTP2Request.sync_request"; // $NON-NLS-1$
public static final String PROTOCOL = "HTTP2Request.protocol"; // $NON-NLS-1$
public static final String REQUEST_ID = "HTTP2Request.request_id"; // $NON-NLS-1$
/**
* This is the encoding used for the content, i.e. the charset name, not the header "Content-Encoding"
*/
public static final String CONTENT_ENCODING = "HTTP2Request.contentEncoding"; // $NON-NLS-1$
public static final String PATH = "HTTP2Request.path"; // $NON-NLS-1$
private static ThreadLocal