Author: pmouawad
Date: Fri Mar  2 23:39:17 2012
New Revision: 1296513

URL: http://svn.apache.org/viewvc?rev=1296513&view=rev
Log:
Bug 52674 - Proxy : Add a Sampler Creator to allow plugging HTTP based samplers 
using potentially non textual POST Body (AMF, Silverlight...) and customizing 
them for others

Modified:
    
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java

Modified: 
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java?rev=1296513&r1=1296512&r2=1296513&view=diff
==============================================================================
--- 
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
 (original)
+++ 
jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
 Fri Mar  2 23:39:17 2012
@@ -569,7 +569,7 @@ public class TestHttpRequestHdr  extends
     }
 
     private HTTPSamplerBase getSamplerForRequest(String url, String request, 
String contentEncoding)
-            throws IOException {
+            throws Exception {
         HttpRequestHdr req = new HttpRequestHdr();
         ByteArrayInputStream bis = null;
         if(contentEncoding != null) {
@@ -587,7 +587,11 @@ public class TestHttpRequestHdr  extends
         if(url != null && contentEncoding != null) {
             pageEncodings.put(url, contentEncoding);
         }
-        return req.getSampler(pageEncodings, formEncodings);
+        SamplerCreatorFactory creatorFactory = new SamplerCreatorFactory();
+        SamplerCreator creator = creatorFactory.getSamplerCreator(req, 
pageEncodings, formEncodings);
+        HTTPSamplerBase sampler = creator.createSampler(req, pageEncodings, 
formEncodings);
+        creator.populateSampler(sampler, req, pageEncodings, formEncodings);
+        return sampler;
     }
     
     private void checkArgument(


Reply via email to