Bug 45479 - Support for multiple HTTP Header Manager nodes
Summary: Support for multiple HTTP Header Manager nodes
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.3.3
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2008-07-24 16:15 UTC by Andrew Alsup
Modified: 2008-10-02 12:52 UTC (History)
0 users

SVN diff of my changes (5.09 KB, patch)
2008-07-24 16:15 UTC, Andrew Alsup
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

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.

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
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.