Package org.sentinel.servers.http.protocol

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

package org.sentinel.servers.http.protocol;

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

public class HTTPResponseHeadersTest
{

    @Test
    public void testToString()
    {
        HTTPResponseHeaders headers = new HTTPResponseHeaders("HTTP/1.1 200");
        assertEquals("HTTP/1.1 200 OK\n", headers.toString());
    }

    @Test
    public void testToStringWithBadStatusCode()
    {
        HTTPResponseHeaders headers = new HTTPResponseHeaders("HTTP/1.1 999");
        assertEquals("HTTP/1.1 999\n", headers.toString());
    }
   
    @Test
    public void testVersion()
    {
        HTTPResponseHeaders headers = new HTTPResponseHeaders();
        headers.setVersion("HTTP/1.1");
        assertEquals("HTTP/1.1", headers.getVersion());
    }
   
    @Test
    public void testStatus()
    {
        HTTPResponseHeaders headers = new HTTPResponseHeaders();
        headers.setStatus(304);
        assertEquals(304, headers.getStatus());
    }

}
TOP

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

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.