Package org.sentinel.servers.http.protocol

Examples of org.sentinel.servers.http.protocol.HTTPHeaders


    @Test
    public void testGet()
    {
        try {
            HTTPHeaders headers = new HTTPHeaders();
            headers.add(new HTTPHeader("key", "value"));
            assertEquals("value", headers.get("key").getValue());
        }
        catch(NoSuchHTTPHeaderException ex) {
            fail(ex.getMessage());
        }
    }
View Full Code Here


    @Test
    public void testGetNonExistantHeader()
    {
        try {
            HTTPHeaders headers = new HTTPHeaders();
            assertEquals("value", headers.get("key").getValue());
            fail("Should of failed before this point.");
        }
        catch(NoSuchHTTPHeaderException ex) {
            // good
        }
View Full Code Here

    @Test
    public void testAddOrReplace()
    {
        try {
            HTTPHeaders headers = new HTTPHeaders();
            headers.addOrReplace(new HTTPHeader("key", "value"));
            assertEquals("value", headers.get("key").getValue());
           
            headers.addOrReplace(new HTTPHeader("key", "value2"));
            assertEquals("value2", headers.get("key").getValue());
        }
        catch(NoSuchHTTPHeaderException ex) {
            fail(ex.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.sentinel.servers.http.protocol.HTTPHeaders

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.