|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.jmeter.protocol.http.sampler.HTTPSamplerFull
A sampler that downloads downloadable components such as images, applets, etc.
For HTML files, this class will download binary files specified in the following ways (where url represents the binary file to be downloaded):
Finally, this class does not process Style Sheets either.
Nested Class Summary | |
static class |
HTTPSamplerFull.Test
|
Field Summary | |
protected URL |
baseUrl
Used to store the base URL. |
protected static String |
utfEncodingName
Used to store the UTF encoding name (which is version dependent). |
Constructor Summary | |
HTTPSamplerFull()
This is the only Constructor. |
Method Summary | |
protected static org.w3c.dom.Node |
getDOM(String text)
Returns a node representing a whole xml given an xml document. |
protected int |
getErrorLevel(HttpURLConnection conn,
SampleResult res)
Get the response code of the URL connection and divide it by 100 thus returning 2 (for 2xx response codes), 3 (for 3xx reponse codes), etc. |
protected static org.w3c.tidy.Tidy |
getParser()
Returns tidy as HTML parser. |
protected static String |
getUTFEncodingName()
Returns the encoding type which is different for different jdks even though they mean the same thing (for example, UTF8 or UTF-8). |
protected byte[] |
loadBinary(URL url,
SampleResult res,
HTTPSampler sampler)
Download the binary file from the given URL . |
protected SampleResult |
parseForImages(SampleResult res,
HTTPSampler sampler)
|
protected void |
parseNodes(org.w3c.dom.Document html,
String htmlTag,
boolean type,
String srcTag,
Set uniques,
SampleResult res,
HTTPSampler sampler)
Parse the DOM tree looking for the specified HTML source tags, and download the appropriate binary files matching these tags. |
SampleResult |
sample(HTTPSampler sampler)
Samples the Entry passed in and stores the result in
SampleResult . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static String utfEncodingName
getUTFEncodingName()
protected URL baseUrl
<base href=url>
Constructor Detail |
public HTTPSamplerFull()
Method Detail |
public SampleResult sample(HTTPSampler sampler)
Entry
passed in and stores the result in
SampleResult
. The original file (which is assumed to be
an HTML file) is parsed into a DOM tree and examined for embedded binary
files.
Note that files that are duplicated within the enclosing document will only be downloaded once.
protected SampleResult parseForImages(SampleResult res, HTTPSampler sampler)
protected void parseNodes(org.w3c.dom.Document html, String htmlTag, boolean type, String srcTag, Set uniques, SampleResult res, HTTPSampler sampler)
html
- the HTML document to parsehtmlTag
- the HTML tag to parse fortype
- indicates that we require 'type=image'srcTag
- the HTML tag that indicates the source URLuniques
- used to ensure that binary files are only downloaded onceres
- SampleResult
to store sampling resultsprotected byte[] loadBinary(URL url, SampleResult res, HTTPSampler sampler) throws Exception
URL
.
url
- URL
from where binary is to be downloadedres
- SampleResult
to store sampling results
IOException
- indicates a problem reading from the URL
Exception
protected int getErrorLevel(HttpURLConnection conn, SampleResult res)
conn
- HttpURLConnection
of URL requestres
- where all results of sampling will be stored
protected static org.w3c.tidy.Tidy getParser()
tidy
as HTML parser.
tidy
HTML parserprotected static org.w3c.dom.Node getDOM(String text) throws org.xml.sax.SAXException
text
- an xml document
org.xml.sax.SAXException
- indicates an error parsing the xml documentprotected static String getUTFEncodingName()
utfEncodingName
|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |