protected HttpClient setupConnection(URL u, HttpMethodBase httpMethod) throws IOException { HTTPSampleResult temp = new HTTPSampleResult(); return super.setupConnection(u, httpMethod, temp); }
/** * {@inheritDoc} */ @Override public void testEnded() { if (isConcurrentDwn()) { ResourcesDownloader.getInstance().shrink(); } }
private void setPutHeaders(URLConnection conn) throws IOException { postOrPutWriter = new PutWriter(); postOrPutWriter.setHeaders(conn, testElement); }
/** {@inheritDoc} */ @Override protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth) { // When Retrieve Embedded resources + Concurrent Pool is used // as the instance of Proxy is cloned, we end up with impl being null // testIterationStart will not be executed but it's not a problem for 51380 as it's download of resources // so SSL context is to be reused if (impl == null) { // Not called from multiple threads, so this is OK try { impl = HTTPSamplerFactory.getImplementation(getImplementation(), this); } catch (Exception ex) { return errorResult(ex, new HTTPSampleResult()); } } return impl.sample(u, method, areFollowingRedirect, depth); }
/** * Set request headers in preparation to opening a connection. * * @param conn * <code>URLConnection</code> to set headers on * @exception IOException * if an I/O exception occurs */ protected void setPostHeaders(URLConnection conn) throws IOException { postOrPutWriter = new PostWriter(); postOrPutWriter.setHeaders(conn, testElement); }
/** * Invokes {@link HTTPSamplerBase#getIpSource()} * * @return the configured ip source for the associated test element */ protected String getIpSource() { return testElement.getIpSource(); }
/** * Invokes {@link HTTPSamplerBase#getDoBrowserCompatibleMultipart()} * * @return flag whether we should do browser compatible multiparts */ protected boolean getDoBrowserCompatibleMultipart() { return testElement.getDoBrowserCompatibleMultipart(); }
@Override public boolean interrupt() { if (impl != null) { return impl.interrupt(); // Forward to sampler } return false; }
/** * {@inheritDoc} */ @Override public void testStarted() { started = true; super.testStarted(); }
/** * * @return the encoding of the content, i.e. its charset name */ public String getContentEncoding() { return getPropertyAsString(CONTENT_ENCODING); }
/** * set IP source to use - does not apply to Java HTTP implementation currently * * @param value IP source to use */ public void setIpSource(String value) { setProperty(IP_SOURCE, value, ""); }
/** * * @return the value of {@link #getContentEncoding()}; forced to null if empty */ private String getContentEncodingOrNull() { return getContentEncoding(null); }
/** * {@inheritDoc} */ @Override public void setPort(int port) { SAMPLE.setPort(port); }
/** * Invokes {@link HTTPSamplerBase#getAutoRedirects()} * * @return flag whether to do auto redirects */ protected boolean getAutoRedirects() { return testElement.getAutoRedirects(); }
/** * Invokes {@link HTTPSamplerBase#getConnectTimeout()} * * @return the connect timeout of the associated test element */ protected int getConnectTimeout() { return testElement.getConnectTimeout(); }
/** * Determine whether to send concatenated parameters as the entire body of an * entity enclosing request such as POST, PUT or PATCH. * * Invokes {@link HTTPSamplerBase#getSendParameterValuesAsPostBody()} * * @return flag whether to send concatenated parameters as the entire body */ protected boolean getSendParameterValuesAsPostBody() { return testElement.getSendParameterValuesAsPostBody(); }
@Override protected HTTPSampleResult sample(java.net.URL u, String method, boolean areFollowingRedirect, int depth) { return hc.sample(u, method, areFollowingRedirect, depth); } }
/** * sample(Entry e) simply calls sample(). * * @param e - * ignored * @return the new sample */ @Override public SampleResult sample(Entry e) { return sampleWithParser(); }
/** * {@inheritDoc} */ @Override public void testEnded(String host) { testEnded(); }
protected HttpClient setupConnection(URL u, HttpMethodBase httpMethod) throws IOException { HTTPSampleResult temp = new HTTPSampleResult(); return super.setupConnection(u, httpMethod, temp); }