Package org.sentinel.servers.http.protocol

Source Code of org.sentinel.servers.http.protocol.HTTPHeaderTest

package org.sentinel.servers.http.protocol;

import org.sentinel.servers.http.protocol.HTTPHeader;
import static org.junit.Assert.*;
import org.junit.Test;

public class HTTPHeaderTest
{

    @Test
    public void testInstantiation1()
    {
        HTTPHeader header = new HTTPHeader("abc", "def");
        assertEquals("abc", header.getName());
        assertEquals("def", header.getValue());
    }

    @Test
    public void testInstantiation2()
    {
        HTTPHeader header = new HTTPHeader("abc: def");
        assertEquals("abc", header.getName());
        assertEquals("def", header.getValue());
    }

    @Test
    public void testNameValue()
    {
        HTTPHeader header = new HTTPHeader("", "");
        header.setName("123");
        assertEquals("123", header.getName());
    }

    @Test
    public void testValue()
    {
        HTTPHeader header = new HTTPHeader("", "");
        header.setValue("456");
        assertEquals("456", header.getValue());
    }

    @Test
    public void testToString()
    {
        HTTPHeader header = new HTTPHeader("abc", "def");
        assertEquals("abc: def", header.toString());
    }
   
}
TOP

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

TOP
Copyright © 2018 www.massapi.com. 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.