Ah, that helps greatly.

try putting the headers into the manager and then calling 
sampler.setHeaderManager(manager).  JMeter is doing lots of funky things 
during test runs.  In essense, it's searching your header manager for headers 
and finds none, so it gets tossed.  It does this because values from multiple 
headers potentially have to be merged (in a certain order) and the sampler 
has to be returned to original condition after each run - all without cloning 
objects all over the place.

-Mike

On 16 Sep 2003 at 8:52, Aaron Hamid wrote:

> It's not.
> 
> public void process() {
>   ...
> 
>   Header header = new Header("Authorization", authstring);
>   HeaderManager manager = sampler.getHeaderManager();
>   if (manager != null) {
>     manager.add(header);
>   } else {
>     log.error("No header manager configured for sampler: " + sampler);
>     manager = new HeaderManager();
>     sampler.setHeaderManager(manager);
>     manager.add(header);
>     System.out.println("manager size: " + manager.size());
>     for (int i = 0; i < manager.size(); i++) {
>       System.out.println("header: " + manager.get(i));
>     }
>     System.out.println("manager: " + sampler.getHeaderManager());
>   }
> 
> My header is indeed in the manager as the loop proves, but it is not 
coming out in the request (although I can see the fixed user-agent header I 
set through a HeaderManager GUI).  Can anybody else verify this?  (I tried 
with a header named something other than "Authorization" just in case, and it 
doesn't come through either)
> 
> Aaron
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> > Making a new HeaderManager and calling setHeaderManager 
> > ought to work.
> > 
> > -Mike
> > 
> > On 15 Sep 2003 at 12:19, Aaron Hamid wrote:
> > 
> > 
> >>Hi, I have written a pre-processor that modifies headers on an 
HTTPSampler (I need to do this because the header is dynamically derived), 
but the call getHeaderManager() on the HTTPSampler object always returns 
null.  Even if I have actually created a HeaderManager in the test 
configuration.  Creating a new HeaderManager object and programmatically 
calling setHeaderManager on the HTTPSampler object in my preprocessor 
doesn't do anything either.  Is there a way to dynamically modify outgoing 
request headers?
> >>
> >>Aaron Hamid
> >>CIT/I&D
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: jmeter-dev-
> > 
> > [EMAIL PROTECTED]
> > 
> >>For additional commands, e-mail: jmeter-dev-
> > 
> > [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > 
> > --
> > Michael Stover
> > [EMAIL PROTECTED]
> > Yahoo IM: mstover_ya
> > ICQ: 152975688
> > AIM: mstover777
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




--
Michael Stover
[EMAIL PROTECTED]
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to