protected HttpClient setupConnection(URL u, HttpMethodBase httpMethod) throws IOException { HTTPSampleResult temp = new HTTPSampleResult(); return super.setupConnection(u, httpMethod, temp); }
protected HttpClient setupConnection(URL u, HttpMethodBase httpMethod) throws IOException { HTTPSampleResult temp = new HTTPSampleResult(); return super.setupConnection(u, httpMethod, temp); }
/** {@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); }
/** * Create HTTPSampleResult filling url, method and SampleLabel. * Monitor field is computed calling isMonitor() * @param url URL * @param method HTTP Method * @return {@link HTTPSampleResult} */ protected HTTPSampleResult createSampleResult(URL url, String method) { HTTPSampleResult res = new HTTPSampleResult(); res.setSampleLabel(this.testElement.getName()); res.setHTTPMethod(method); res.setURL(url); return res; }
HTTPSampleResult res = new HTTPSampleResult(); res.setSamplerData(req.toString()); res.setRequestHeaders("\n");
boolean areFollowingRedirect, int frameDepth) { HTTPSampleResult res = new HTTPSampleResult();
if (thisCount < 0) // Was there an error? return errorResult(new Error("Problem parsing the log file"), new HTTPSampleResult()); return errorResult(new Error("No entries found"), new HTTPSampleResult()); return errorResult(e, new HTTPSampleResult());
/** * Perform a sample, and return the results * * @return results of the sampling */ public SampleResult sample() { SampleResult res = null; try { res = sample(getUrl(), getMethod(), false, 0); if (res != null) { res.setSampleLabel(getName()); } return res; } catch (Exception e) { return errorResult(e, new HTTPSampleResult()); } }
@Override protected HTTPSampleResult sample(URL url, String method, boolean frd, int fd) { HTTPSampleResult res = new HTTPSampleResult(); res.setSampleLabel(url.toExternalForm()); res.sampleStart(); try { setupConnection(url, method, res); activeChannel = channel; execute(method, res); res.sampleEnd(); res.setResponseData(responseData.toByteArray()); return res; } catch(IOException iex) { res.sampleEnd(); lastPort = -1; // force reopen on next sample channel = null; return errorResult(iex, res); } finally { activeChannel = null; JOrphanUtils.closeQuietly(body); body = null; } }
res.addSubResult(errorResult(e, new HTTPSampleResult(res))); setParentSampleSuccess(res, false); lContainer = new HTTPSampleResult(res); lContainer.addRawSubResult(res); url = escapeIllegalURLCharacters(url); } catch (Exception e) { // NOSONAR res.addSubResult(errorResult(new Exception(url.toString() + " is not a correct URI", e), new HTTPSampleResult(res))); setParentSampleSuccess(res, false); continue; url = url.toURI().normalize().toURL(); } catch (MalformedURLException | URISyntaxException e) { res.addSubResult(errorResult(new Exception(url.toString() + " URI can not be normalized", e), new HTTPSampleResult(res))); setParentSampleSuccess(res, false); continue; res.addSubResult(errorResult(new Exception(binURL + " is not a correct URI", e), new HTTPSampleResult(res))); setParentSampleSuccess(res, false);
HTTPSampleResult errSubResult = new HTTPSampleResult(res); errSubResult.removeSubResults(); res.addSubResult(errorResult(new Exception("Maximum frame/iframe nesting depth exceeded."), errSubResult));
HTTPSampleResult res = new HTTPSampleResult();
HTTPSampleResult totalRes = new HTTPSampleResult(res); totalRes.addRawSubResult(res); HTTPSampleResult lastRes = res; lastRes = errorResult(new IOException("Exceeded maximum number of redirects: " + MAX_REDIRECTS), new HTTPSampleResult(lastRes)); totalRes.addSubResult(lastRes);