You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/10/25 16:45:36 UTC

svn commit: r707848 - in /jakarta/jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java xdocs/changes.xml

Author: sebb
Date: Sat Oct 25 07:45:36 2008
New Revision: 707848

URL: http://svn.apache.org/viewvc?rev=707848&view=rev
Log:
Add version attribute to JMeter Cookie class (needed for proper cookie support)

Modified:
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java?rev=707848&r1=707847&r2=707848&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/Cookie.java Sat Oct 25 07:45:36 2008
@@ -47,6 +47,10 @@
 
     private static final String DOMAIN_SPECIFIED = "Cookie.domain_specified"; //$NON-NLS-1$
 
+    private static final String VERSION = "Cookie.version"; //$NON-NLS-1$
+
+    private static final int DEFAULT_VERSION = 1;
+
     /**
      * create the coookie
      */
@@ -74,6 +78,24 @@
      */
     public Cookie(String name, String value, String domain, String path,
             boolean secure, long expires, boolean hasPath, boolean hasDomain) {
+        this(name, value, domain, path, secure, expires, hasPath, hasDomain, DEFAULT_VERSION);
+    }
+
+    /**
+     * Create a JMeter Cookie.
+     * 
+     * @param name
+     * @param value
+     * @param domain
+     * @param path
+     * @param secure
+     * @param expires - this is in seconds
+     * @param hasPath - was the path explicitly specified?
+     * @param hasDomain - was the domain explicitly specified?
+     * @param version - cookie spec. version
+     */
+    public Cookie(String name, String value, String domain, String path,
+            boolean secure, long expires, boolean hasPath, boolean hasDomain, int version) {
         this.setName(name);
         this.setValue(value);
         this.setDomain(domain);
@@ -82,6 +104,7 @@
         this.setExpires(expires);
         this.setPathSpecified(hasPath);
         this.setDomainSpecified(hasDomain);
+        this.setVersion(version);
     }
 
     public void addConfigElement(ConfigElement config) {
@@ -203,5 +226,19 @@
         return sb.toString();
     }
 
+    /**
+     * @return the version
+     */
+    public synchronized int getVersion() {
+        return getPropertyAsInt(VERSION, DEFAULT_VERSION);
+    }
+
+    /**
+     * @param version the version to set
+     */
+    public synchronized void setVersion(int version) {
+        setProperty(VERSION, version, DEFAULT_VERSION);
+    }
+
 
 }

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=707848&r1=707847&r2=707848&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Sat Oct 25 07:45:36 2008
@@ -133,6 +133,7 @@
 <li>Bug 45425 - JDBC Request does not support Unicode (changed sampler to use UTF-8)</li>
 <li>Bug 46016 - avoid possible NPE in JMSSampler</li>
 <li>Cookie Manager was not passing cookie policy to runtime threads so they always used compatibility mode</li>
+<li>Add version attribute to JMeter Cookie class (needed for proper cookie support)</li>
 </ul>
 
 <h3>Improvements</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org