abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@cam.ac.uk
Subject Problem with RequestOptions.addHeader
Date Wed, 11 May 2011 08:41:32 GMT
Hi,

The org.apache.abdera.protocol.client.RequestOptions.addHeader method 
seems to be broken right now.

The following unit tests illustrate the problem:

     @Test
     public void testAddHeader() {
         RequestOptions options = new RequestOptions();
         options.addHeader("User-Agent", "Foo");

         // This fails:
         //      java.lang.AssertionError: expected:<1> but was:<0>
         assertEquals(1, options.getHeaderNames().length);
         assertEquals("Foo", options.getHeader("User-Agent"));

     }

     @Test
     public void testSetThenAddHeader() {

         RequestOptions options = new RequestOptions();
         options.setHeader("User-Agent", "Foo");

         assertEquals(1, options.getHeaderNames().length);
         assertEquals("Foo", options.getHeader("User-Agent"));

         // This throws:
         //      java.lang.UnsupportedOperationException
         options.addHeader("User-Agent", "Bar");
     }

Regards,

Sam



Mime
View raw message