Bug 52674

Summary: Proxy : Add a Sampler Creator to allow plugging HTTP based samplers using potentially non textual POST Body (AMF, Silverlight...) and customizing them for others
Product: JMeter - Now in Github Reporter: Philippe Mouawad <p.mouawad>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: cilsteph63, p.mouawad
Priority: P2    
Version: 2.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Bug Depends on: 52675    
Bug Blocks: 40424    
Attachments: Patch proposal
Patch with Test updated

Description Philippe Mouawad 2012-02-15 21:26:31 UTC
It would be useful to have the ability to plug a Sampler Customizer that depending on content type.

One example I need currently is the following:
- For GWT samplers for example it would be useful to be able to directly set element.setProperty(HTTPSamplerBase.POST_BODY_RAW, useRaw, HTTPSamplerBase.POST_BODY_RAW_DEFAULT);


Another requirement I have is to be able to customize created sampler, 
A direct use I see is for example a SilverLight or Flex protocol, doing this will enable plugins to implement a factory and use current implementations of Proxy, ProxyControl and HttpRequestHdr.

This could be done by delaying sampler creation until rawPostBody and contentType are available in HttpRequestHdr, once these are available , a factory could be called with content type , this would enable plugging other Samplers than just HttpSampler.
Comment 1 Philippe Mouawad 2012-02-26 20:02:30 UTC
Created attachment 28385 [details]
Patch proposal
Comment 2 Philippe Mouawad 2012-02-28 17:39:23 UTC
Created attachment 28398 [details]
Patch with Test updated

Hello,
I made some thorough testing of the code.
I also implemented an Binary (POST body) based protocol successfully by implementing a SamplerCreator subclass.
I think this feature will be very useful to allow recording protocols as AMF , Silverlight by plugins.

Can I commit it or you want to review it first ?
Thanks

Regards
Philippe
Comment 3 Philippe Mouawad 2012-03-02 23:38:20 UTC
Date: Fri Mar  2 23:37:26 2012
New Revision: 1296512

URL: http://svn.apache.org/viewvc?rev=1296512&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

Added:
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/AbstractSamplerCreator.java   (with props)
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/DefaultSamplerCreator.java   (with props)
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreator.java   (with props)
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java   (with props)
Modified:
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
   jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
   jmeter/trunk/xdocs/changes.xml
Comment 4 Philippe Mouawad 2012-03-02 23:40:18 UTC
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
Comment 5 Philippe Mouawad 2012-06-27 21:17:24 UTC
*** Bug 49039 has been marked as a duplicate of this bug. ***
Comment 6 The ASF infrastructure team 2022-09-24 20:37:49 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2735