Java Doc for HTTPSamplerBase.java in  » Testing » jakarta-jmeter » org » apache » jmeter » protocol » http » sampler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.protocol.http.sampler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.jmeter.samplers.AbstractSampler
   org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase

All known Subclasses:   org.apache.jmeter.protocol.http.sampler.WebServiceSampler,  org.apache.jmeter.protocol.http.sampler.HTTPNullSampler,  org.apache.jmeter.protocol.http.sampler.AjpSampler,  org.apache.jmeter.protocol.http.sampler.HTTPSampler2,  org.apache.jmeter.protocol.http.sampler.HTTPSampler,
HTTPSamplerBase
abstract public class HTTPSamplerBase extends AbstractSampler implements TestListener,ThreadListener,HTTPConstantsInterface(Code)
Common constants and methods for HTTP samplers


Field Summary
final public static  StringARGUMENTS
    
final public static  StringAUTH_MANAGER
    
final public static  StringAUTO_REDIRECTS
    
final public static  StringCLIENT
    
final public static  StringCONTENT_ENCODING
    
final public static  StringCONTENT_TYPE
    
final public static  StringCOOKIE_MANAGER
    
final public static  StringDEFAULT_METHOD
    
final public static  StringDOMAIN
    
final public static  StringDO_MULTIPART_POST
    
final public static  StringEMBEDDED_URL_RE
    
final public static  StringFILE_FIELD
    
final public static  StringFILE_NAME
    
final public static  StringFOLLOW_REDIRECTS
    
final public static  StringHEADER_MANAGER
    
final public static  StringIMAGE_PARSER
    
final public static  StringIMPLEMENTATION
    
final protected static  intMAX_FRAME_DEPTH
    
final protected static  intMAX_REDIRECTS
    
final public static  StringMETHOD
    
final public static  StringMIMETYPE
    
final public static  StringMONITOR
    
final protected static  StringNON_HTTP_RESPONSE_CODE
    
final protected static  StringNON_HTTP_RESPONSE_MESSAGE
    
final public static  StringPATH
    
final public static  StringPORT
    
final public static  StringPROTOCOL
    
final public static  intUNSPECIFIED_PORT
     A number to indicate that the port has not been set.
final public static  StringUNSPECIFIED_PORT_AS_STRING
    
final public static  StringURL
    
final public static  StringUSE_KEEPALIVE
    

Constructor Summary
public  HTTPSamplerBase()
    

Method Summary
public  voidaddArgument(String name, String value)
    
public  voidaddArgument(String name, String value, String metadata)
    
public  voidaddEncodedArgument(String name, String value)
    
public  voidaddEncodedArgument(String name, String value, String metaData, String contentEncoding)
    
public  voidaddEncodedArgument(String name, String value, String metaData)
    
public  voidaddNonEncodedArgument(String name, String value, String metadata)
    
public  voidaddTestElement(TestElement el)
    
public  Objectclone()
    
protected  HTTPSampleResultdownloadPageResources(HTTPSampleResult res, HTTPSampleResult container, int frameDepth)
     Download the resources of an HTML page.

If createContainerResult is true, the returned result will contain one subsample for each request issued, including the original one that was passed in.

protected static  StringencodeBackSlashes(String value)
    
protected  StringencodeSpaces(String path)
    
protected  HTTPSampleResulterrorResult(Throwable e, HTTPSampleResult res)
     Obtain a result that will help inform the user that an error has occured during sampling, and how long it took to detect the error.
protected  HTTPSampleResultfollowRedirects(HTTPSampleResult res, int frameDepth)
     Iteratively download the redirect targets of a redirect response.

The returned result will contain one subsample for each request issued, including the original one that was passed in.

public  ArgumentsgetArguments()
    
public  AuthManagergetAuthManager()
    
public  booleangetAutoRedirects()
    
public  StringgetClient()
    
public  StringgetContentEncoding()
    
public  CookieManagergetCookieManager()
    
public static  intgetDefaultPort(String protocol, int port)
    
public  booleangetDoMultipartPost()
    
public  StringgetDomain()
    
public  StringgetEmbeddedUrlRE()
     Get the regular expression URLs must match.
public  StringgetFileField()
    
public  StringgetFilename()
    
public  booleangetFollowRedirects()
    
public  HeaderManagergetHeaderManager()
    
public  StringgetImplementation()
    
public  StringgetMethod()
    
public  StringgetMimetype()
    
public  StringgetMonitor()
    
public  StringgetPath()
    
public  intgetPort()
    
public  StringgetProtocol()
    
public  StringgetQueryString()
    
public  StringgetQueryString(String contentEncoding)
    
public  booleangetSendFileAsPostBody()
     Determine if the file should be sent as the entire Post body, i.e.
public  booleangetSendParameterValuesAsPostBody()
    
public  URLgetUrl()
     Get the URL, built from its component parts.
public  booleangetUseKeepAlive()
    
public  booleangetUseMultipartForPost()
    
public static  String[]getValidMethodsAsArray()
    
public  booleanhasArguments()
    
protected  booleanhasUploadableFiles()
    
public  booleanisImageParser()
    
public  booleanisMonitor()
    
public  booleanisProtocolDefaultPort()
    
public static  booleanisSecure(String protocol)
    
public static  booleanisSecure(URL url)
    
protected  booleanisSuccessCode(int code)
     Determine if the HTTP status code is successful or not i.e.
public  voidparseArguments(String queryString, String contentEncoding)
     This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object. For each name found, addArgument() is called
Parameters:
  queryString - -the query string
Parameters:
  contentEncoding - -the content encoding of the query string.
public  voidparseArguments(String queryString)
    
protected  HTTPSampleResultresultProcessing(boolean areFollowingRedirect, int frameDepth, HTTPSampleResult res)
     Follow redirects and download page resources if appropriate.
public  SampleResultsample(Entry e)
     Do a sampling and return its results.
public  SampleResultsample()
    
abstract protected  HTTPSampleResultsample(URL u, String method, boolean areFollowingRedirect, int depth)
     Samples the URL passed in and stores the result in HTTPSampleResult, following redirects and downloading page resources as appropriate.

When getting a redirect target, redirects are not followed and resources are not downloaded.

public  voidsetArguments(Arguments value)
    
public  voidsetAuthManager(AuthManager value)
    
public  voidsetAutoRedirects(boolean value)
    
public  voidsetClient(String client)
    
public  voidsetContentEncoding(String value)
    
public  voidsetCookieManager(CookieManager value)
    
public  voidsetDoMultipartPost(boolean value)
    
public  voidsetDomain(String value)
    
public  voidsetEmbeddedUrlRE(String regex)
    
public  voidsetFileField(String value)
    
public  voidsetFilename(String value)
    
public  voidsetFollowRedirects(boolean value)
    
public  voidsetHeaderManager(HeaderManager value)
    
public  voidsetImageParser(boolean parseImages)
    
public  voidsetImplementation(String value)
    
public  voidsetMethod(String value)
    
public  voidsetMimetype(String value)
    
public  voidsetMonitor(String value)
    
public  voidsetMonitor(boolean truth)
    
public  voidsetPath(String path)
    
public  voidsetPath(String path, String contentEncoding)
    
public  voidsetPort(int value)
    
public  voidsetProtocol(String value)
    
public  voidsetUseKeepAlive(boolean value)
    
public  voidtestEnded()
    
public  voidtestEnded(String host)
    
public  voidtestIterationStart(LoopIterationEvent event)
    
public  voidtestStarted()
    
public  voidtestStarted(String host)
    
public  voidthreadFinished()
    
public  voidthreadStarted()
    
public  StringtoString()
    

Field Detail
ARGUMENTS
final public static String ARGUMENTS(Code)



AUTH_MANAGER
final public static String AUTH_MANAGER(Code)



AUTO_REDIRECTS
final public static String AUTO_REDIRECTS(Code)



CLIENT
final public static String CLIENT(Code)



CONTENT_ENCODING
final public static String CONTENT_ENCODING(Code)



CONTENT_TYPE
final public static String CONTENT_TYPE(Code)



COOKIE_MANAGER
final public static String COOKIE_MANAGER(Code)



DEFAULT_METHOD
final public static String DEFAULT_METHOD(Code)



DOMAIN
final public static String DOMAIN(Code)



DO_MULTIPART_POST
final public static String DO_MULTIPART_POST(Code)



EMBEDDED_URL_RE
final public static String EMBEDDED_URL_RE(Code)



FILE_FIELD
final public static String FILE_FIELD(Code)



FILE_NAME
final public static String FILE_NAME(Code)



FOLLOW_REDIRECTS
final public static String FOLLOW_REDIRECTS(Code)



HEADER_MANAGER
final public static String HEADER_MANAGER(Code)



IMAGE_PARSER
final public static String IMAGE_PARSER(Code)



IMPLEMENTATION
final public static String IMPLEMENTATION(Code)



MAX_FRAME_DEPTH
final protected static int MAX_FRAME_DEPTH(Code)



MAX_REDIRECTS
final protected static int MAX_REDIRECTS(Code)



METHOD
final public static String METHOD(Code)



MIMETYPE
final public static String MIMETYPE(Code)



MONITOR
final public static String MONITOR(Code)



NON_HTTP_RESPONSE_CODE
final protected static String NON_HTTP_RESPONSE_CODE(Code)



NON_HTTP_RESPONSE_MESSAGE
final protected static String NON_HTTP_RESPONSE_MESSAGE(Code)



PATH
final public static String PATH(Code)



PORT
final public static String PORT(Code)



PROTOCOL
final public static String PROTOCOL(Code)



UNSPECIFIED_PORT
final public static int UNSPECIFIED_PORT(Code)
A number to indicate that the port has not been set. *



UNSPECIFIED_PORT_AS_STRING
final public static String UNSPECIFIED_PORT_AS_STRING(Code)



URL
final public static String URL(Code)



USE_KEEPALIVE
final public static String USE_KEEPALIVE(Code)




Constructor Detail
HTTPSamplerBase
public HTTPSamplerBase()(Code)




Method Detail
addArgument
public void addArgument(String name, String value)(Code)



addArgument
public void addArgument(String name, String value, String metadata)(Code)



addEncodedArgument
public void addEncodedArgument(String name, String value)(Code)
Add an argument which has already been encoded



addEncodedArgument
public void addEncodedArgument(String name, String value, String metaData, String contentEncoding)(Code)



addEncodedArgument
public void addEncodedArgument(String name, String value, String metaData)(Code)



addNonEncodedArgument
public void addNonEncodedArgument(String name, String value, String metadata)(Code)



addTestElement
public void addTestElement(TestElement el)(Code)



clone
public Object clone()(Code)



downloadPageResources
protected HTTPSampleResult downloadPageResources(HTTPSampleResult res, HTTPSampleResult container, int frameDepth)(Code)
Download the resources of an HTML page.

If createContainerResult is true, the returned result will contain one subsample for each request issued, including the original one that was passed in. It will otherwise look exactly like that original one.

If createContainerResult is false, one subsample will be added to the provided result for each requests issued.
Parameters:
  res - result of the initial request - must contain an HTML response
Parameters:
  container - for storing the results
Parameters:
  frameDepth - Depth of this target in the frame structure. Used only toprevent infinite recursion. "Container" result with one subsample per request issued




encodeBackSlashes
protected static String encodeBackSlashes(String value)(Code)



encodeSpaces
protected String encodeSpaces(String path)(Code)



errorResult
protected HTTPSampleResult errorResult(Throwable e, HTTPSampleResult res)(Code)
Obtain a result that will help inform the user that an error has occured during sampling, and how long it took to detect the error.
Parameters:
  e - Exception representing the error.
Parameters:
  res - SampleResult a sampling result useful to inform the user about the exception.



followRedirects
protected HTTPSampleResult followRedirects(HTTPSampleResult res, int frameDepth)(Code)
Iteratively download the redirect targets of a redirect response.

The returned result will contain one subsample for each request issued, including the original one that was passed in. It will be an HTTPSampleResult that should mostly look as if the final destination of the redirect chain had been obtained in a single shot.
Parameters:
  res - result of the initial request - must be a redirect response
Parameters:
  frameDepth - Depth of this target in the frame structure. Used only toprevent infinite recursion. "Container" result with one subsample per request issued




getArguments
public Arguments getArguments()(Code)



getAuthManager
public AuthManager getAuthManager()(Code)



getAutoRedirects
public boolean getAutoRedirects()(Code)



getClient
public String getClient()(Code)



getContentEncoding
public String getContentEncoding()(Code)



getCookieManager
public CookieManager getCookieManager()(Code)



getDefaultPort
public static int getDefaultPort(String protocol, int port)(Code)



getDoMultipartPost
public boolean getDoMultipartPost()(Code)



getDomain
public String getDomain()(Code)



getEmbeddedUrlRE
public String getEmbeddedUrlRE()(Code)
Get the regular expression URLs must match. regular expression (or empty) string



getFileField
public String getFileField()(Code)
The name parameter to be applied to the file



getFilename
public String getFilename()(Code)
The actual name of the file to POST



getFollowRedirects
public boolean getFollowRedirects()(Code)



getHeaderManager
public HeaderManager getHeaderManager()(Code)



getImplementation
public String getImplementation()(Code)



getMethod
public String getMethod()(Code)



getMimetype
public String getMimetype()(Code)



getMonitor
public String getMonitor()(Code)



getPath
public String getPath()(Code)



getPort
public int getPort()(Code)



getProtocol
public String getProtocol()(Code)



getQueryString
public String getQueryString()(Code)
Gets the QueryString attribute of the UrlConfig object, using UTF-8 to encode the URL the QueryString value



getQueryString
public String getQueryString(String contentEncoding)(Code)
Gets the QueryString attribute of the UrlConfig object, using the specified encoding to encode the parameter values put into the URL
Parameters:
  contentEncoding - the encoding to use for encoding parameter values the QueryString value



getSendFileAsPostBody
public boolean getSendFileAsPostBody()(Code)
Determine if the file should be sent as the entire Post body, i.e. without any additional wrapping true if specified file is to be sent as the body,i.e. FileField is blank



getSendParameterValuesAsPostBody
public boolean getSendParameterValuesAsPostBody()(Code)
Determine if none of the parameters have a name, and if that is the case, it means that the parameter values should be sent as the post body true if none of the parameters have a name specified



getUrl
public URL getUrl() throws MalformedURLException(Code)
Get the URL, built from its component parts. The URL to be requested by this sampler.
throws:
  MalformedURLException -



getUseKeepAlive
public boolean getUseKeepAlive()(Code)



getUseMultipartForPost
public boolean getUseMultipartForPost()(Code)
Determine if we should use multipart/form-data or application/x-www-form-urlencoded for the post true if multipart/form-data should be used and method is POST



getValidMethodsAsArray
public static String[] getValidMethodsAsArray()(Code)



hasArguments
public boolean hasArguments()(Code)



hasUploadableFiles
protected boolean hasUploadableFiles()(Code)
Method to tell if the request has any files to be uploaded



isImageParser
public boolean isImageParser()(Code)



isMonitor
public boolean isMonitor()(Code)



isProtocolDefaultPort
public boolean isProtocolDefaultPort()(Code)
Tell whether the default port for the specified protocol is used true if the default port number for the protocol is used, false otherwise



isSecure
public static boolean isSecure(String protocol)(Code)



isSecure
public static boolean isSecure(URL url)(Code)



isSuccessCode
protected boolean isSuccessCode(int code)(Code)
Determine if the HTTP status code is successful or not i.e. in range 200 to 399 inclusive whether in range 200-399 or not



parseArguments
public void parseArguments(String queryString, String contentEncoding)(Code)
This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object. For each name found, addArgument() is called
Parameters:
  queryString - -the query string
Parameters:
  contentEncoding - -the content encoding of the query string. The query string mightactually be the post body of a http post request.



parseArguments
public void parseArguments(String queryString)(Code)



resultProcessing
protected HTTPSampleResult resultProcessing(boolean areFollowingRedirect, int frameDepth, HTTPSampleResult res)(Code)
Follow redirects and download page resources if appropriate. this works, but the container stuff here is what's doing it. followRedirects() is actually doing the work to make sure we have only one container to make this work more naturally, I think this method - sample() - needs to take an HTTPSamplerResult container parameter instead of a boolean:areFollowingRedirect.
Parameters:
  areFollowingRedirect -
Parameters:
  frameDepth -
Parameters:
  res - the sample result



sample
public SampleResult sample(Entry e)(Code)
Do a sampling and return its results.
Parameters:
  e - Entry to be sampled results of the sampling



sample
public SampleResult sample()(Code)
Perform a sample, and return the results results of the sampling



sample
abstract protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth)(Code)
Samples the URL passed in and stores the result in HTTPSampleResult, following redirects and downloading page resources as appropriate.

When getting a redirect target, redirects are not followed and resources are not downloaded. The caller will take care of this.
Parameters:
  u - URL to sample
Parameters:
  method - HTTP method: GET, POST,...
Parameters:
  areFollowingRedirect - whether we're getting a redirect target
Parameters:
  depth - Depth of this target in the frame structure. Used only toprevent infinite recursion. results of the sampling




setArguments
public void setArguments(Arguments value)(Code)



setAuthManager
public void setAuthManager(AuthManager value)(Code)



setAutoRedirects
public void setAutoRedirects(boolean value)(Code)



setClient
public void setClient(String client)(Code)



setContentEncoding
public void setContentEncoding(String value)(Code)



setCookieManager
public void setCookieManager(CookieManager value)(Code)



setDoMultipartPost
public void setDoMultipartPost(boolean value)(Code)



setDomain
public void setDomain(String value)(Code)



setEmbeddedUrlRE
public void setEmbeddedUrlRE(String regex)(Code)



setFileField
public void setFileField(String value)(Code)
The name parameter to be applied to the file



setFilename
public void setFilename(String value)(Code)
The actual name of the file to POST



setFollowRedirects
public void setFollowRedirects(boolean value)(Code)



setHeaderManager
public void setHeaderManager(HeaderManager value)(Code)



setImageParser
public void setImageParser(boolean parseImages)(Code)



setImplementation
public void setImplementation(String value)(Code)



setMethod
public void setMethod(String value)(Code)



setMimetype
public void setMimetype(String value)(Code)



setMonitor
public void setMonitor(String value)(Code)



setMonitor
public void setMonitor(boolean truth)(Code)



setPath
public void setPath(String path)(Code)
Sets the Path attribute of the UrlConfig object Also calls parseArguments to extract and store any query arguments
Parameters:
  path - The new Path value



setPath
public void setPath(String path, String contentEncoding)(Code)
Sets the Path attribute of the UrlConfig object Also calls parseArguments to extract and store any query arguments
Parameters:
  path - The new Path value
Parameters:
  contentEncoding - The encoding used for the querystring parameter values



setPort
public void setPort(int value)(Code)



setProtocol
public void setProtocol(String value)(Code)



setUseKeepAlive
public void setUseKeepAlive(boolean value)(Code)



testEnded
public void testEnded()(Code)



testEnded
public void testEnded(String host)(Code)



testIterationStart
public void testIterationStart(LoopIterationEvent event)(Code)



testStarted
public void testStarted()(Code)



testStarted
public void testStarted(String host)(Code)



threadFinished
public void threadFinished()(Code)



threadStarted
public void threadStarted()(Code)



toString
public String toString()(Code)




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.