Package com.volantis.synergetics.runtime.impl

Examples of com.volantis.synergetics.runtime.impl.DefaultMutableHttpHeaders


    private static String mark = "(c) Volantis Systems Ltd 2004.";

    // Javadoc inherited.
    public MutableHttpHeaders createHTTPHeaders() {

        return new DefaultMutableHttpHeaders();
    }
View Full Code Here


    /**
     * Test empty (newly created) headers.
     */
    public void testEmpty() {

        MutableHttpHeaders headers = new DefaultMutableHttpHeaders();

        assertNull("", headers.getHeader("unknown"));

        Enumeration names = headers.getHeaderNames();
        assertNotNull("", names);
        assertEquals("", false, names.hasMoreElements());

        Enumeration values = headers.getHeaders("unknown");
        assertNotNull("", values);
        assertEquals("", false, values.hasMoreElements());
    }
View Full Code Here

    /**
     * Test a single header with a single value.
     */
    public void testSingleHeader() {

        MutableHttpHeaders headers = new DefaultMutableHttpHeaders();

        headers.addHeader("h1", "v1");

        assertEquals("", "v1", headers.getHeader("h1"));

        Enumeration names = headers.getHeaderNames();
        assertNotNull("", names);
        assertEquals("", true, names.hasMoreElements());
        assertEquals("", "h1", names.nextElement());
        assertEquals("", false, names.hasMoreElements());

        Enumeration values = headers.getHeaders("h1");
        assertNotNull("", values);
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v1", values.nextElement());
        assertEquals("", false, values.hasMoreElements());
    }
View Full Code Here

    /**
     * Test adding the same header twice with different case.
     */
    public void testHeaderNameCase() {

        MutableHttpHeaders headers = new DefaultMutableHttpHeaders();

        headers.addHeader("h1", "v1");
        headers.addHeader("H1", "V2");

        assertEquals("", "v1", headers.getHeader("h1"));

        Enumeration names = headers.getHeaderNames();
        assertNotNull("", names);
        assertEquals("", true, names.hasMoreElements());
        assertEquals("", "h1", names.nextElement());
        assertEquals("", false, names.hasMoreElements());

        Enumeration values = headers.getHeaders("H1");
        assertNotNull("", values);
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v1", values.nextElement());
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "V2", values.nextElement());
View Full Code Here

    /**
     * Test multiple headers with single values.
     */
    public void testMultipleHeaders() {

        MutableHttpHeaders headers = new DefaultMutableHttpHeaders();

        headers.addHeader("h1", "v1");
        headers.addHeader("h2", "v2");

        assertEquals("", "v1", headers.getHeader("h1"));
        assertEquals("", "v2", headers.getHeader("h2"));

        Enumeration names = headers.getHeaderNames();
        assertNotNull("", names);
        assertEquals("", true, names.hasMoreElements());
        assertEquals("", "h1", names.nextElement());
        assertEquals("", true, names.hasMoreElements());
        assertEquals("", "h2", names.nextElement());
        assertEquals("", false, names.hasMoreElements());

        Enumeration values = headers.getHeaders("h1");
        assertNotNull("", values);
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v1", values.nextElement());
        assertEquals("", false, values.hasMoreElements());

        values = headers.getHeaders("h2");
        assertNotNull("", values);
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v2", values.nextElement());
        assertEquals("", false, values.hasMoreElements());
    }
View Full Code Here

    /**
     * Test a header with multiple values.
     */
    public void testMultipleHeaderValues() {

        MutableHttpHeaders headers = new DefaultMutableHttpHeaders();

        headers.addHeader("h1", "v1");
        headers.addHeader("h1", "v2");
        headers.addHeader("h1", "v3");

        assertEquals("", "v1", headers.getHeader("h1"));

        Enumeration names = headers.getHeaderNames();
        assertNotNull("", names);
        assertEquals("", true, names.hasMoreElements());
        assertEquals("", "h1", names.nextElement());
        assertEquals("", false, names.hasMoreElements());

        Enumeration values = headers.getHeaders("h1");
        assertNotNull("", values);
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v1", values.nextElement());
        assertEquals("", true, values.hasMoreElements());
        assertEquals("", "v2", values.nextElement());
View Full Code Here

TOP

Related Classes of com.volantis.synergetics.runtime.impl.DefaultMutableHttpHeaders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.