jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1648709 - in /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http: control/AuthManager.java control/Cookie.java util/ConversionUtils.java util/DOMPool.java
Date Wed, 31 Dec 2014 14:48:21 GMT
Author: fschumacher
Date: Wed Dec 31 14:48:21 2014
New Revision: 1648709

URL: http://svn.apache.org/r1648709
Log:
Bug 57193: Add param and return tags to javadoc
Bugzilla Id: 57193

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java?rev=1648709&r1=1648708&r2=1648709&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
Wed Dec 31 14:48:21 2014
@@ -134,6 +134,21 @@ public class AuthManager extends ConfigT
 
     /**
      * Update an authentication record.
+     *
+     * @param index
+     *            index at which position the record should be set
+     * @param url
+     *            url for which the authentication record should be used
+     * @param user
+     *            name of the user
+     * @param pass
+     *            password of the user
+     * @param domain
+     *            domain of the user
+     * @param realm
+     *            realm of the site
+     * @param mechanism
+     *            authentication {@link Mechanism} to use
      */
     public void set(int index, String url, String user, String pass, String domain, String
realm, Mechanism mechanism) {
         Authorization auth = new Authorization(url, user, pass, domain, realm, mechanism);
@@ -170,6 +185,10 @@ public class AuthManager extends ConfigT
 
     /**
      * Return the record at index i
+     *
+     * @param i
+     *            index of the record to get
+     * @return authorization record at index <code>i</code>
      */
     public Authorization get(int i) {
         return (Authorization) getAuthObjects().get(i).getObjectValue();
@@ -233,14 +252,25 @@ public class AuthManager extends ConfigT
     }
 
     /**
-     * @return boolean true if an authorization is setup for url
+     * Tests whether an authorization record is available for a given URL
+     *
+     * @param url
+     *            {@link URL} for which an authorization record should be
+     *            available
+     * @return <code>true</code> if an authorization is setup for url,
+     *         <code>false</code> otherwise
      */
     public boolean hasAuthForURL(URL url) {
         return getAuthForURL(url) != null;
     }
     
     /**
-     * @return Subject if Auth Scheme uses Subject and an authorization is setup for url
+     * Get a {@link Subject} for a given URL, if available
+     *
+     * @param url
+     *            {@link URL} for which the subject was asked
+     * @return Subject if Auth Scheme uses Subject and an authorization is setup
+     *         for <code>url</code>, <code>null</code> otherwise
      */
     public Subject getSubjectForUrl(URL url) {
         Authorization authorization = getAuthForURL(url);
@@ -258,7 +288,7 @@ public class AuthManager extends ConfigT
 
     /**
      * Add newAuthorization if it does not already exist
-     * @param newAuthorization
+     * @param newAuthorization authorization to be added
      */
     public void addAuth(Authorization newAuthorization) {
         boolean alreadyExists=false;
@@ -296,6 +326,11 @@ public class AuthManager extends ConfigT
 
     /**
      * Save the authentication data to a file.
+     *
+     * @param authFile
+     *            path of the file to save the authentication data to
+     * @throws IOException
+     *             when writing to the file fails
      */
     public void save(String authFile) throws IOException {
         File file = new File(authFile);
@@ -319,6 +354,11 @@ public class AuthManager extends ConfigT
 
     /**
      * Add authentication data from a file.
+     *
+     * @param authFile
+     *            path to the file to read the authentication data from
+     * @throws IOException
+     *             when reading the data fails
      */
     public void addFile(String authFile) throws IOException {
         File file = new File(authFile);
@@ -370,6 +410,9 @@ public class AuthManager extends ConfigT
 
     /**
      * Remove an authentication record.
+     *
+     * @param index
+     *            index of the authentication record to remove
      */
     public void remove(int index) {
         getAuthObjects().remove(index);
@@ -389,6 +432,8 @@ public class AuthManager extends ConfigT
 
     /**
      * Return the number of records.
+     *
+     * @return the number of records
      */
     public int getAuthCount() {
         return getAuthObjects().size();

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java?rev=1648709&r1=1648708&r2=1648709&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java Wed
Dec 31 14:48:21 2014
@@ -62,7 +62,11 @@ public class Cookie extends AbstractTest
 
     /**
      * create the coookie
-     *
+     * @param name name of the cookie
+     * @param value value of the cookie
+     * @param domain domain for which the cookie is valid
+     * @param path  path for which the cookie is valid
+     * @param secure flag whether cookie is to be handled as 'secure'
      * @param expires - this is in seconds
      *
      */
@@ -72,7 +76,11 @@ public class Cookie extends AbstractTest
 
     /**
      * create the coookie
-     *
+     * @param name name of the cookie
+     * @param value value of the cookie
+     * @param domain domain for which the cookie is valid
+     * @param path path for which the cookie is valid
+     * @param secure flag whether cookie is to be handled as 'secure'
      * @param expires - this is in seconds
      * @param hasPath - was the path explicitly specified?
      * @param hasDomain - was the domain explicitly specified?
@@ -86,11 +94,11 @@ public class Cookie extends AbstractTest
     /**
      * Create a JMeter Cookie.
      * 
-     * @param name
-     * @param value
-     * @param domain
-     * @param path
-     * @param secure
+     * @param name name of the cookie
+     * @param value value of the cookie
+     * @param domain domain for which the cookie is valid
+     * @param path path for which the cookie is valid
+     * @param secure flag whether cookie is to be handled as 'secure'
      * @param expires - this is in seconds
      * @param hasPath - was the path explicitly specified?
      * @param hasDomain - was the domain explicitly specified?
@@ -114,6 +122,8 @@ public class Cookie extends AbstractTest
 
     /**
      * get the value for this object.
+     *
+     * @return the value of this cookie
      */
     public String getValue() {
         return getPropertyAsString(VALUE);
@@ -121,6 +131,8 @@ public class Cookie extends AbstractTest
 
     /**
      * set the value for this object.
+     *
+     * @param value the value of this cookie
      */
     public void setValue(String value) {
         this.setProperty(VALUE, value);
@@ -128,6 +140,8 @@ public class Cookie extends AbstractTest
 
     /**
      * get the domain for this object.
+     *
+     * @return the domain for which this cookie is valid
      */
     public String getDomain() {
         return getPropertyAsString(DOMAIN);
@@ -135,6 +149,8 @@ public class Cookie extends AbstractTest
 
     /**
      * set the domain for this object.
+     *
+     * @param domain the domain for which this cookie is valid
      */
     public void setDomain(String domain) {
         setProperty(DOMAIN, domain);
@@ -169,6 +185,8 @@ public class Cookie extends AbstractTest
 
     /**
      * get the secure for this object.
+     *
+     * @return flag whether this cookie should be treated as a 'secure' cookie
      */
     public boolean getSecure() {
         return getPropertyAsBoolean(SECURE);
@@ -176,6 +194,8 @@ public class Cookie extends AbstractTest
 
     /**
      * set the secure for this object.
+     *
+     * @param secure flag whether this cookie should be treated as a 'secure' cookie
      */
     public void setSecure(boolean secure) {
         setProperty(new BooleanProperty(SECURE, secure));
@@ -183,6 +203,8 @@ public class Cookie extends AbstractTest
 
     /**
      * get the path for this object.
+     *
+     * @return the path for which this cookie is valid
      */
     public String getPath() {
         return getPropertyAsString(PATH);
@@ -190,6 +212,8 @@ public class Cookie extends AbstractTest
 
     /**
      * set the path for this object.
+     *
+     * @param path the path for which this cookie is valid
      */
     public void setPath(String path) {
         setProperty(PATH, path);

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java?rev=1648709&r1=1648708&r2=1648709&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
Wed Dec 31 14:48:21 2014
@@ -49,12 +49,15 @@ public class ConversionUtils {
     private static final String COLONSLASHSLASH = "://"; // $NON-NLS-1$
 
     /**
-     * Extract the encoding (charset) from the Content-Type,
-     * e.g. "text/html; charset=utf-8".
+     * Extract the encoding (charset) from the Content-Type, e.g.
+     * "text/html; charset=utf-8".
      *
      * @param contentType
-     * @return the charset encoding - or null, if none was found or the charset is not supported
-     * @throws IllegalCharsetNameException 
+     *            string from which the encoding should be extracted
+     * @return the charset encoding - or <code>null</code>, if none was found
or
+     *         the charset is not supported
+     * @throws IllegalCharsetNameException
+     *             if the found charset is not supported
      */
     public static String getEncodingFromContentType(String contentType){
         String charSet = null;
@@ -95,7 +98,7 @@ public class ConversionUtils {
      * @param baseURL the base URL which is used to resolve missing protocol/host in the
location
      * @param location the location, possibly with extraneous leading "../"
      * @return URL with extraneous ../ removed
-     * @throws MalformedURLException
+     * @throws MalformedURLException when the given <code>URL</code> is malformed
      * @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=46690">Bug
46690 - handling of 302 redirects with invalid relative paths</a>
      */
     public static URL makeRelativeURL(URL baseURL, String location) throws MalformedURLException{
@@ -121,7 +124,7 @@ public class ConversionUtils {
     /**
      * @param url String Url to escape
      * @return String cleaned up url
-     * @throws Exception
+     * @throws Exception when given <code>url</code> leads to a malformed URL
or URI
      */
     public static String escapeIllegalURLCharacters(String url) throws Exception{
         String decodeUrl = URLDecoder.decode(url,"UTF-8");
@@ -136,7 +139,7 @@ public class ConversionUtils {
      * Warning: it may not work on all unencoded URLs.
      * @param url non-encoded URL
      * @return URI which has been encoded as necessary
-     * @throws URISyntaxException
+     * @throws URISyntaxException if parts of the url form a non valid URI
      */
     public static final URI sanitizeUrl(URL url) throws URISyntaxException {
         try {
@@ -155,10 +158,11 @@ public class ConversionUtils {
 
     /**
      * collapses absolute or relative URLs containing '/..' converting
-     * http://host/path1/../path2 to http://host/path2 or /one/two/../three to
-     * /one/three
+     * <code>http://host/path1/../path2</code> to <code>http://host/path2</code>
+     * or <code>/one/two/../three</code> to
+     * <code>/one/three</code>
      * 
-     * @param url
+     * @param url in which the '/..'s should be removed
      * @return collapsed URL
      * @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=49083">Bug
49083 - collapse /.. in redirect URLs</a>
      */

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java?rev=1648709&r1=1648708&r2=1648709&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/DOMPool.java Wed Dec
31 14:48:21 2014
@@ -54,7 +54,7 @@ public final class DOMPool {
     /**
      * Return a document.
      *
-     * @param key
+     * @param key key of the document
      * @return Document
      */
     public static Document getDocument(Object key) {
@@ -64,8 +64,8 @@ public final class DOMPool {
     /**
      * Add an object to the cache.
      *
-     * @param key
-     * @param data
+     * @param key key of the document
+     * @param data Document to store
      */
     public static void putDocument(Object key, Document data) {
         MEMCACHE.put(key, data);



Mime
View raw message