jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1655168 - in /jmeter/branches/HC4: ./ lib/ res/maven/ src/protocol/http/org/apache/jmeter/protocol/http/control/ src/protocol/http/org/apache/jmeter/protocol/http/sampler/
Date Tue, 27 Jan 2015 21:39:37 GMT
Author: sebb
Date: Tue Jan 27 21:39:37 2015
New Revision: 1655168

URL: http://svn.apache.org/r1655168
Log:
Updates to HC4 library

Added:
    jmeter/branches/HC4/
      - copied from r1655096, jmeter/trunk/
Modified:
    jmeter/branches/HC4/build.properties
    jmeter/branches/HC4/eclipse.classpath
    jmeter/branches/HC4/lib/   (props changed)
    jmeter/branches/HC4/res/maven/ApacheJMeter_parent.pom
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/MeasuringConnectionManager.java

Modified: jmeter/branches/HC4/build.properties
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/build.properties?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/build.properties (original)
+++ jmeter/branches/HC4/build.properties Tue Jan 27 21:39:37 2015
@@ -181,23 +181,23 @@ htmlparser.loc              = ${maven2.r
 htmlparser.jar              = htmlparser-${htmlparser.version}.jar
 htmlparser.md5              = aa05b921026c228f92ef8b4a13c26f8d
 
-# Apache HttpClient 4.x
-httpclient.version          = 4.2.6
+# Apache HttpClient 4.x (4.4-beta1?)
+httpclient.version          = 4.3.6
 #
 httpclient.jar              = httpclient-${httpclient.version}.jar
 httpclient.loc              = ${maven2.repo}/org/apache/httpcomponents/httpclient/${httpclient.version}
-httpclient.md5              = 7bae53a30550dd3eb62db72ab08fcd94
+httpclient.md5              = 2d29a27bb6c6b44bc8a608a0e5d09735
 
 # Required for HttpClient
 httpmime.jar                = httpmime-${httpclient.version}.jar
 httpmime.loc                = ${maven2.repo}/org/apache/httpcomponents/httpmime/${httpclient.version}
-httpmime.md5                = 291ec6eac9dfb76f2b8c4f1b647b9a21
+httpmime.md5                = e473a311b870d724670dff9daf5ccc3e
 
 # Required for HttpClient
-httpcore.version            = 4.2.5
+httpcore.version            = 4.4
 httpcore.jar                = httpcore-${httpcore.version}.jar
 httpcore.loc                = ${maven2.repo}/org/apache/httpcomponents/httpcore/${httpcore.version}
-httpcore.md5                = 7e23d35d533b24c1f385724e8b5ba623
+httpcore.md5                = e016cf1346ba3f65302c3d71c5b91f44
 
 jakarta-oro.version         = 2.0.8
 jakarta-oro.jar             = oro-${jakarta-oro.version}.jar

Modified: jmeter/branches/HC4/eclipse.classpath
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/eclipse.classpath?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/eclipse.classpath (original)
+++ jmeter/branches/HC4/eclipse.classpath Tue Jan 27 21:39:37 2015
@@ -68,9 +68,9 @@
 	<classpathentry kind="lib" path="lib/geronimo-jms_1.1_spec-1.1.1.jar"/>
 	<classpathentry kind="lib" path="lib/htmllexer-2.1.jar"/>
 	<classpathentry kind="lib" path="lib/htmlparser-2.1.jar"/>
-	<classpathentry kind="lib" path="lib/httpclient-4.2.6.jar"/>
-	<classpathentry kind="lib" path="lib/httpcore-4.2.5.jar"/>
-	<classpathentry kind="lib" path="lib/httpmime-4.2.6.jar"/>
+	<classpathentry kind="lib" path="lib/httpclient-4.3.6.jar"/>
+	<classpathentry kind="lib" path="lib/httpcore-4.4.jar"/>
+	<classpathentry kind="lib" path="lib/httpmime-4.3.6.jar"/>
 	<classpathentry kind="lib" path="lib/jcharts-0.7.5.jar"/>
 	<classpathentry kind="lib" path="lib/jdom-1.1.3.jar"/>
 	<classpathentry kind="lib" path="lib/jodd-core-3.6.3.jar"/>

Propchange: jmeter/branches/HC4/lib/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan 27 21:39:37 2015
@@ -25,9 +25,9 @@ excalibur-pool-instrumented-2.1.jar
 geronimo*.jar
 htmllexer-2.1.jar
 htmlparser-2.1.jar
-httpclient-4.2.6.jar
-httpcore-4.2.5.jar
-httpmime-4.2.6.jar
+httpclient-4.3.6.jar
+httpcore-4.4.jar
+httpmime-4.3.6.jar
 jcharts-0.7.5.jar
 jdom-1.1.3.jar
 jms*.jar

Modified: jmeter/branches/HC4/res/maven/ApacheJMeter_parent.pom
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/res/maven/ApacheJMeter_parent.pom?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/res/maven/ApacheJMeter_parent.pom (original)
+++ jmeter/branches/HC4/res/maven/ApacheJMeter_parent.pom Tue Jan 27 21:39:37 2015
@@ -78,8 +78,8 @@ under the License.
       <excalibur-pool-impl.version>${excalibur-pool.version}</excalibur-pool-impl.version>
       <excalibur-pool-instrumented.version>${excalibur-pool.version}</excalibur-pool-instrumented.version>
       <htmlparser.version>2.1</htmlparser.version>
-      <httpclient.version>4.2.6</httpclient.version>
-      <httpcore.version>4.2.5</httpcore.version>
+      <httpclient.version>4.3.6</httpclient.version>
+      <httpcore.version>4.4</httpcore.version>
       <jakarta-oro.version>2.0.8</jakarta-oro.version>
       <jcharts.version>0.7.5</jcharts.version>
       <jdom.version>1.1.3</jdom.version>

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
Tue Jan 27 21:39:37 2015
@@ -39,7 +39,7 @@ import org.apache.http.auth.Credentials;
 import org.apache.http.auth.NTCredentials;
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.HttpClient;
-import org.apache.http.client.params.AuthPolicy;
+import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.impl.auth.SPNegoSchemeFactory;
 import org.apache.http.impl.client.AbstractHttpClient;
 import org.apache.jmeter.config.ConfigElement;
@@ -464,7 +464,7 @@ public class AuthManager extends ConfigT
                 log.debug(username + " > D="+domain+" R="+realm + " M="+auth.getMechanism());
             }
             if (Mechanism.KERBEROS.equals(auth.getMechanism())) {
-                ((AbstractHttpClient) client).getAuthSchemes().register(AuthPolicy.SPNEGO,
new SPNegoSchemeFactory(isStripPort(url)));
+                ((AbstractHttpClient) client).getAuthSchemes().register(AuthSchemes.SPNEGO,
new SPNegoSchemeFactory(isStripPort(url)));
                 credentialsProvider.setCredentials(new AuthScope(null, -1, null), USE_JAAS_CREDENTIALS);
             } else {
                 credentialsProvider.setCredentials(

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
Tue Jan 27 21:39:37 2015
@@ -35,8 +35,7 @@ import org.apache.commons.httpclient.URI
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.impl.cookie.DateParseException;
-import org.apache.http.impl.cookie.DateUtils;
+import org.apache.http.client.utils.DateUtils;
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.engine.event.LoopIterationEvent;
 import org.apache.jmeter.protocol.http.sampler.HTTPSampleResult;
@@ -198,12 +197,8 @@ public class CacheManager extends Config
                 return;
             }
             if (expires != null) {
-                try {
-                    expiresDate = DateUtils.parseDate(expires);
-                } catch (org.apache.http.impl.cookie.DateParseException e) {
-                    if (log.isDebugEnabled()){
-                        log.debug("Unable to parse Expires: '"+expires+"' "+e);
-                    }
+                expiresDate = DateUtils.parseDate(expires);
+                if (expiresDate == null) {
                     expiresDate = CacheManager.EXPIRED_DATE; // invalid dates must be treated
as expired
                 }
             }
@@ -219,14 +214,14 @@ public class CacheManager extends Config
 
                 } else if(expires==null) { // No max-age && No expires
                     if(!StringUtils.isEmpty(lastModified) && !StringUtils.isEmpty(date))
{
-                        try {
-                            Date responseDate = DateUtils.parseDate( date );
-                            Date lastModifiedAsDate = DateUtils.parseDate( lastModified );
+                        Date responseDate = DateUtils.parseDate( date );
+                        Date lastModifiedAsDate = DateUtils.parseDate( lastModified );
+                        if (responseDate != null && lastModifiedAsDate != null) {
                             // see https://developer.mozilla.org/en/HTTP_Caching_FAQ
                             // see http://www.ietf.org/rfc/rfc2616.txt#13.2.4 
                             expiresDate=new Date(System.currentTimeMillis()
-                                    +Math.round((responseDate.getTime()-lastModifiedAsDate.getTime())*0.1));
-                        } catch(DateParseException e) {
+                                    +Math.round((responseDate.getTime()-lastModifiedAsDate.getTime())*0.1));
                               
+                        } else {
                             // date or lastModified may be null or in bad format
                             if(log.isWarnEnabled()) {
                                 log.warn("Failed computing expiration date with following
info:"

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
Tue Jan 27 21:39:37 2015
@@ -30,7 +30,7 @@ import java.io.Serializable;
 import java.net.URL;
 import java.util.ArrayList;
 
-import org.apache.http.client.params.CookiePolicy;
+import org.apache.http.client.config.CookieSpecs;
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.engine.event.LoopIterationEvent;
 import org.apache.jmeter.testelement.TestIterationListener;
@@ -101,7 +101,7 @@ public class CookieManager extends Confi
 
     private transient CollectionProperty initialCookies;
 
-    public static final String DEFAULT_POLICY = CookiePolicy.BROWSER_COMPATIBILITY;
+    public static final String DEFAULT_POLICY = CookieSpecs.BROWSER_COMPATIBILITY;
     
     public static final String DEFAULT_IMPLEMENTATION = HC3CookieHandler.class.getName();
 

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java
Tue Jan 27 21:39:37 2015
@@ -25,10 +25,12 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.http.Header;
-import org.apache.http.client.params.CookiePolicy;
+import org.apache.http.client.config.CookieSpecs;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
 import org.apache.http.cookie.CookieOrigin;
 import org.apache.http.cookie.CookieSpec;
-import org.apache.http.cookie.CookieSpecRegistry;
+import org.apache.http.cookie.CookieSpecProvider;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.impl.cookie.BasicClientCookie;
 import org.apache.http.impl.cookie.BestMatchSpecFactory;
@@ -50,23 +52,26 @@ public class HC4CookieHandler implements
     
     private final transient CookieSpec cookieSpec;
     
-    private static CookieSpecRegistry registry  = new CookieSpecRegistry();
+    private static final Registry<CookieSpecProvider> registry;
 
     static {
-        registry.register(CookiePolicy.BEST_MATCH, new BestMatchSpecFactory());
-        registry.register(CookiePolicy.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory());
-        registry.register(CookiePolicy.RFC_2109, new RFC2109SpecFactory());
-        registry.register(CookiePolicy.RFC_2965, new RFC2965SpecFactory());
-        registry.register(CookiePolicy.IGNORE_COOKIES, new IgnoreSpecFactory());
-        registry.register(CookiePolicy.NETSCAPE, new NetscapeDraftSpecFactory());
+        RegistryBuilder<CookieSpecProvider> builder = RegistryBuilder.<CookieSpecProvider>create();
+        builder.register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory());
+        builder.register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory());
+        builder.register("CookieSpecs.RFC_2109", new RFC2109SpecFactory());
+        builder.register("CookieSpecs.RFC_2965", new RFC2965SpecFactory());
+        builder.register(CookieSpecs.IGNORE_COOKIES, new IgnoreSpecFactory());
+        builder.register(CookieSpecs.NETSCAPE, new NetscapeDraftSpecFactory());
+        registry = builder.build();
     }
 
     public HC4CookieHandler(String policy) {
         super();
         if (policy.equals(org.apache.commons.httpclient.cookie.CookiePolicy.DEFAULT)) { //
tweak diff HC3 vs HC4
-            policy = CookiePolicy.BEST_MATCH;
+            policy = CookieSpecs.BEST_MATCH;
         }
-        this.cookieSpec = registry.getCookieSpec(policy);
+        // TODO not sure why create has a parameter; it does not appear to use it
+        this.cookieSpec = registry.lookup(policy).create(null);
     }
 
     @Override

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Tue Jan 27 21:39:37 2015
@@ -72,7 +72,7 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpTrace;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.params.ClientPNames;
-import org.apache.http.client.params.CookiePolicy;
+import org.apache.http.client.config.CookieSpecs;
 import org.apache.http.client.protocol.ResponseContentEncoding;
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;
@@ -703,7 +703,7 @@ public class HTTPHC4Impl extends HTTPHCA
             }
 
             // Bug 52126 - we do our own cookie handling
-            clientParams.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.IGNORE_COOKIES);
+            clientParams.setParameter(ClientPNames.COOKIE_POLICY, CookieSpecs.IGNORE_COOKIES);
 
             if (log.isDebugEnabled()) {
                 log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient)
+ " " + key.toString());

Modified: jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/MeasuringConnectionManager.java
URL: http://svn.apache.org/viewvc/jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/MeasuringConnectionManager.java?rev=1655168&r1=1655096&r2=1655168&view=diff
==============================================================================
--- jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/MeasuringConnectionManager.java
(original)
+++ jmeter/branches/HC4/src/protocol/http/org/apache/jmeter/protocol/http/sampler/MeasuringConnectionManager.java
Tue Jan 27 21:39:37 2015
@@ -36,8 +36,10 @@ import org.apache.http.protocol.HttpCont
 import org.apache.jmeter.samplers.SampleResult;
 
 import javax.net.ssl.SSLSession;
+
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.Socket;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -264,5 +266,23 @@ public class MeasuringConnectionManager
         public HttpConnectionMetrics getMetrics() {
             return handler.getMetrics();
         }
+
+        @Override
+        public String getId() {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+        @Override
+        public void bind(Socket socket) throws IOException {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public Socket getSocket() {
+            // TODO Auto-generated method stub
+            return null;
+        }
     }
 }



Mime
View raw message