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


Reply via email to