jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Ambrose <adam_ambr...@access-us-inc.com>
Subject RE: WebResponse headers
Date Wed, 26 Feb 2003 21:35:05 GMT
Yes, I was afraid that it may have to do with our environment here. 
We're using several versions of the httpclient library for different
components, and I suspect that this may be causing some issues. 
Although I haven't tried cactus1.5dev yet, but as was mentioned a
previous response, Cactus is transparent wrt the headers...

One more thing:  you may want to change the "Access" in
"X-Access-HeaderX" to "Test" or something like that, since "Access" is
our company name.

Thanks for looking into this.

-Adam


On Tue, 2003-02-25 at 23:36, Vincent Massol wrote:
> Hi Adam,
> 
> I have just added the following tests to the Cactus test suite:
> 
>     public void testResponseAddHeaders()
>     {
>         response.addHeader("X-Access-Header1", "value1");
>         response.addHeader("X-Access-Header2", "value2");
>     }
> 
>     public void endResponseAddHeaders(WebResponse theResponse) 
>     {
>         String value1 = 
>  
> theResponse.getConnection().getHeaderField("X-Access-Header1");
>         String value2 = 
>  
> theResponse.getConnection().getHeaderField("X-Access-Header2");
> 
>         assertEquals("value1", value1);
>         assertEquals("value2", value2);
>     }
> 
> and
> 
>     public void testResponseAddHeadersHttpUnit()
>     {
>         response.addHeader("X-Access-Header1", "value1");
>         response.addHeader("X-Access-Header2", "value2");
>     }
> 
>     public void endResponseAddHeadersHttpUnit(
>         com.meterware.httpunit.WebResponse theResponse)
>     {
>         String value1 = theResponse.getHeaderField("X-Access-Header1");
>         String value2 = theResponse.getHeaderField("X-Access-Header2");
> 
>         assertEquals("value1", value1);
>         assertEquals("value2", value2);
>     }
> 
> and they both work fine for me.
> 
> I'm using:
> 
> commons-httpclient-2.0alpha2-20030125.jar
> httpunit-1.4.5.jar
> and Cactus 1.5dev
> 
> Hope it helps,
> -Vincent
> 
> > -----Original Message-----
> > From: Adam Ambrose [mailto:adam_ambrose@access-us-inc.com]
> > Sent: 26 February 2003 03:09
> > To: cactus-user@jakarta.apache.org
> > Subject: RE: WebResponse headers
> > 
> > I have a very similar situation to that reported by Paul Christmann on
> > January 17, and I'm curious if any more information has been found out
> > about this issue.  This problem started occurring after a recent
> upgrade
> > from cactus 1.2.
> > 
> > The particulars of my situation:  I have a response header that is
> being
> > set by the servlet under test:  "X-Access-Subnym".   If I use
> > response.containsHeader("X-Access-Subnym") in the testXXX method, it
> > returns true.   However, in the endXXX(HttpUnit WebResponse) method,
> the
> > header is absent (using theResponse.getHeaderField).
> > 
> > I've tried the following versions of the libraries:
> > 
> > cactus-1.4.1
> > 
> > commons-httpclient-2.0alpha1-20020606
> > commons-httpclient-2.0alpha2-20030125
> > 
> > httpunit-1.4.1
> > httpunit-1.4.5
> > httpunit-1.5.2-d-19Feb
> > 
> > 
> > I've also found a strange workaround:  if I set *three* response
> headers
> > at the end of the testXXX() method, then the "X-Access-Subnym" header
> > shows up again (and one of the headers that I set are missing).  It
> > doesn't matter what these dummy headers are called - I've set them as
> > "a", "b", and "c".
> > 
> > 
> > --
> > Adam Ambrose <adam_ambrose@access-us-inc.com>
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
-- 
Adam Ambrose <adam_ambrose@access-us-inc.com>
Access Systems America, Inc.


Mime
View raw message