Package org.sentinel.servers.http.protocol

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


    @Test
    public void test404Response() throws Exception
    {
        org.sentinel.servers.http.Client client = (org.sentinel.servers.http.Client) getClient();
        HTTPResponse response = client.sendRequest("/", "");
       
        assertEquals(404, response.getHTTPHeaders().getStatus());
        assertTrue(response.getRawResponse().contains("Not Found"));
    }
View Full Code Here


    @Test
    public void testSimpleAppResponse() throws Exception
    {
        org.sentinel.servers.http.Client client = (org.sentinel.servers.http.Client) getClient();
        HTTPResponse response = client.sendRequest("/simpleapp?a=1", "");
       
        assertEquals(200, response.getHTTPHeaders().getStatus());
        assertTrue(response.getRawResponse().contains("SimpleApp"));
    }
View Full Code Here

   
    @Test
    public void testFetchStatic() throws Exception
    {
        org.sentinel.servers.http.Client client = (org.sentinel.servers.http.Client) getClient();
        HTTPResponse response = client.sendRequest("/simpleapp/socket.io.js");
       
        assertEquals(100943, (int) Integer.valueOf(response.getHTTPHeaders().get("content-length").getValue()));
    }
View Full Code Here

        // sent request
        byte[] result = sendRawRequest((headers.toString() + data).getBytes());

        // process response
        HTTPResponse response = HTTPResponse.parse(new String(result));
        return response;
    }
View Full Code Here

TOP

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

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.