/** * {@inheritDoc} */ @Override public void setHost(String host) { SAMPLE.setDomain(host); }
/** * Set domain on sampler * @param sampler {@link HTTPSamplerBase} * @param request {@link HttpRequestHdr} */ protected void computeDomain(HTTPSamplerBase sampler, HttpRequestHdr request) { sampler.setDomain(request.serverName()); if (log.isDebugEnabled()) { log.debug("Proxy: setting server: " + sampler.getDomain()); } } }
/** * Create a new Sampler based on an HREF string plus a contextual URL * object. Given that an HREF string might be of three possible forms, some * processing is required. * * @param parsedUrlString * the url from the href * @param context * the context in which the href was found. This is used to * extract url information that might be missing in * <code>parsedUrlString</code> * @return sampler with filled in information about the fully parsed url * @throws MalformedURLException * when the given url (<code>parsedUrlString</code> plus * <code>context</code> is malformed) */ public static HTTPSamplerBase createUrlFromAnchor(String parsedUrlString, URL context) throws MalformedURLException { if (log.isDebugEnabled()) { log.debug("Creating URL from Anchor: " + parsedUrlString + ", base: " + context); } URL url = ConversionUtils.makeRelativeURL(context, parsedUrlString); HTTPSamplerBase sampler =HTTPSamplerFactory.newInstance(); sampler.setDomain(url.getHost()); sampler.setProtocol(url.getProtocol()); sampler.setPort(url.getPort()); sampler.setPath(url.getPath()); sampler.parseArguments(url.getQuery()); return sampler; }
if (nbReplaced>0) { String replacedText = (String) result[0]; setDomain(replacedText); totalReplaced += nbReplaced;
log.debug("Selected: "+url.toString()); sampler.setDomain(url.getDomain()); sampler.setPath(url.getPath()); if (url.getMethod().equals(HTTPConstants.POST)) {
sampler.setDomain(url.getDomain()); sampler.setPath(url.getPath()); if (url.getMethod().equals(HTTPConstants.POST)) {