Package org.eclipse.jetty.toolchain.test

Examples of org.eclipse.jetty.toolchain.test.SimpleRequest


{
    @Test
    public void testBasic() throws Exception
    {
        URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
        SimpleRequest req = new SimpleRequest(serverURI);
        assertThat(req.getString("hello"),is("Hello World"));
    }
View Full Code Here


public class ServerInfoIT
{
    @Test
    public void testGET() throws Exception {
        URI serverURI = new URI("http://localhost:58080/cdi-webapp/");
        SimpleRequest req = new SimpleRequest(serverURI);
        assertThat(req.getString("serverinfo"),is("Hello World"));
    }
View Full Code Here

    }

    @Test
    public void testMissing() throws Exception
    {
        SimpleRequest sr = new SimpleRequest(new URI("http://localhost:" + _connector.getLocalPort()));
        Assert.assertNotNull("missing jetty.css",sr.getString("/resource/jetty-dir.css"));
    }
View Full Code Here

    }

    @Test
    public void testSimple() throws Exception
    {
        SimpleRequest sr = new SimpleRequest(new URI("http://localhost:" + _connector.getLocalPort()));
        Assert.assertEquals("simple text",sr.getString("/resource/simple.txt"));
    }
View Full Code Here

    @Test
    public void testBigFile() throws Exception
    {
        _config.setOutputBufferSize(2048);
        SimpleRequest sr = new SimpleRequest(new URI("http://localhost:" + _connector.getLocalPort()));
        String response = sr.getString("/resource/big.txt");
        Assert.assertThat(response,Matchers.startsWith("     1\tThis is a big file"));
        Assert.assertThat(response,Matchers.endsWith("   400\tThis is a big file" + LN));
    }
View Full Code Here

    @Test
    public void testBigFileBigBuffer() throws Exception
    {
        _config.setOutputBufferSize(16 * 1024);
        SimpleRequest sr = new SimpleRequest(new URI("http://localhost:" + _connector.getLocalPort()));
        String response = sr.getString("/resource/big.txt");
        Assert.assertThat(response,Matchers.startsWith("     1\tThis is a big file"));
        Assert.assertThat(response,Matchers.endsWith("   400\tThis is a big file" + LN));
    }
View Full Code Here

    @Test
    public void testBigFileLittleBuffer() throws Exception
    {
        _config.setOutputBufferSize(8);
        SimpleRequest sr = new SimpleRequest(new URI("http://localhost:" + _connector.getLocalPort()));
        String response = sr.getString("/resource/big.txt");
        Assert.assertThat(response,Matchers.startsWith("     1\tThis is a big file"));
        Assert.assertThat(response,Matchers.endsWith("   400\tThis is a big file" + LN));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.toolchain.test.SimpleRequest

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.