You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2010/11/30 17:07:08 UTC

svn commit: r1040602 - in /jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler: HTTPSampler2.java SoapSampler.java

Author: sebb
Date: Tue Nov 30 16:07:08 2010
New Revision: 1040602

URL: http://svn.apache.org/viewvc?rev=1040602&view=rev
Log:
Oops - need to provide access to HttpSampler2 methods

Modified:
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java

Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java?rev=1040602&r1=1040601&r2=1040602&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java Tue Nov 30 16:07:08 2010
@@ -16,6 +16,13 @@
  */
 package org.apache.jmeter.protocol.http.sampler;
 
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.jmeter.protocol.http.control.CookieManager;
 import org.apache.jmeter.samplers.Interruptible;
 
 /**
@@ -28,7 +35,7 @@ public class HTTPSampler2 extends HTTPSa
 
     private static final long serialVersionUID = 240L;
 
-    private final transient HTTPAbstractImpl hc;
+    private final transient HTTPHC3Impl hc;
     
     public HTTPSampler2(){
         hc = new HTTPHC3Impl(this);
@@ -39,9 +46,31 @@ public class HTTPSampler2 extends HTTPSa
     }
 
     @Override
-    protected HTTPSampleResult sample(java.net.URL u, String method,
+    protected HTTPSampleResult sample(URL u, String method,
             boolean areFollowingRedirect, int depth) {
         return hc.sample(u, method, areFollowingRedirect, depth);
     }
 
+    // Methods needed by subclasses to get access to the implementation
+    protected HttpClient setupConnection(URL url, PostMethod httpMethod, HTTPSampleResult res) 
+        throws IOException {
+        return hc.setupConnection(url, httpMethod, res);
+    }
+
+    protected void saveConnectionCookies(PostMethod httpMethod, URL url,
+            CookieManager cookieManager) {
+        hc.saveConnectionCookies(httpMethod, url, cookieManager);
+   }
+
+    protected String getResponseHeaders(PostMethod httpMethod) {
+        return hc.getResponseHeaders(httpMethod);
+    }
+
+    protected String getConnectionHeaders(PostMethod httpMethod) {
+        return hc.getConnectionHeaders(httpMethod);
+    }
+
+    protected void setSavedClient(HttpClient savedClient) {
+        hc.savedClient = savedClient;
+    }
 }

Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java?rev=1040602&r1=1040601&r2=1040602&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java Tue Nov 30 16:07:08 2010
@@ -250,7 +250,7 @@ public class SoapSampler extends HTTPSam
         try {
             int content_len = setPostHeaders(httpMethod);
             client = setupConnection(url, httpMethod, res);
-            savedClient = client;
+            setSavedClient(client);
 
             res.setQueryString(sendPostData(httpMethod,content_len));
             int statusCode = client.executeMethod(httpMethod);
@@ -351,7 +351,7 @@ public class SoapSampler extends HTTPSam
             return err;
         } finally {
             JOrphanUtils.closeQuietly(instream);
-            savedClient = null;
+            setSavedClient(null);
             httpMethod.releaseConnection();
         }
     }



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