Bug 45479

Summary: Support for multiple HTTP Header Manager nodes
Product: JMeter - Now in Github Reporter: Andrew Alsup <andrew.alsup>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 2.3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: SVN diff of my changes

Description Andrew Alsup 2008-07-24 16:15:11 UTC
Created attachment 22314 [details]
SVN diff of my changes

I've added a small bit of code to support multiple "HTTP Header Manager"
nodes at different scopes.

PREVIOUS:
When HTTPSamplerBase.setHeaderManager(..) is called, it was already
checking if a more locally scoped HeaderManager had already been
assigned.  If so, log a warning and overwrite with the new HeaderManager.

NEW:
The HeaderManager object now supports a merge(..) operation, allowing it
to merge its values with another HeaderManager's.  The result is a new
HeaderManager object with values from both -> with more local-scoped
values take precedence over more distant-scoped values.  So, when
HTTPSamplerBase.setHeaderManager(..) detects a more locally scoped
HeaderManager already assigned, it stores the merged result.

I created one new interface "TestMergeable", anticipating that this
could also be useful for other config elements, such as HTTP Cookie Manager.

The attached .diff is based on current SVN trunk (as of 2008-07-23 @
20:00:00 EDT).
Comment 1 Sebb 2008-10-02 12:52:53 UTC
Thanks for the patch, applied to SVN trunk:

URL: http://svn.apache.org/viewvc?rev=701225&view=rev
Log:
Bug 45479 - Support for multiple HTTP Header Manager nodes


I did not use the TestMergeable interface.
The merge() method in HeaderManager cannot return a HeaderManager - the compiler complains that it is not compatible with TestMergeable. Also, the interface is not used by HttpSamplerBase.
Comment 2 The ASF infrastructure team 2022-09-24 20:37:41 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2140