Package org.mortbay.io.bio

Examples of org.mortbay.io.bio.StringEndPoint


    }

    public void testResponseParse1()
  throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput(
      "HTTP/1.1 304 Not-Modified\015\012"
      + "Connection: close\015\012"
      + "\015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});
View Full Code Here


    }

    public void testResponseParse2()
  throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput(
      "HTTP/1.1 204 No-Content\015\012"
      + "Connection: close\015\012"
      + "\015\012"
      + "HTTP/1.1 200 Correct\015\012"
      + "Content-Length: 10\015\012"
View Full Code Here

    }

    public void testLineParse1()
  throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput("GET /999\015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});

        f2= null;
        Handler handler = new Handler();
View Full Code Here

    }

    public void testLineParse2()
  throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput("POST /222  \015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});

        f2= null;
        Handler handler = new Handler();
View Full Code Here

    }

    public void testLineParse3()
        throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput("POST /fo\u0690 HTTP/1.0\015\012" + "\015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});

        Handler handler = new Handler();
        HttpParser parser= new HttpParser(buffers,io, handler, buffer.capacity(), 0);
View Full Code Here

    }

    public void testLineParse4()
        throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput("POST /foo?param=\u0690 HTTP/1.0\015\012" + "\015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});

        Handler handler = new Handler();
        HttpParser parser= new HttpParser(buffers,io, handler, buffer.capacity(), 0);
View Full Code Here

    }

    public void testConnect()
        throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput("CONNECT 192.168.1.2:80 HTTP/1.1\015\012" + "\015\012");
        ByteArrayBuffer buffer= new ByteArrayBuffer(4096);
        SimpleBuffers buffers=new SimpleBuffers(new Buffer[]{buffer});

        Handler handler = new Handler();
        HttpParser parser= new HttpParser(buffers,io, handler, buffer.capacity(), 0);
View Full Code Here

    }
   
    public void testHeaderParse()
  throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput(
            "GET / HTTP/1.0\015\012"
                + "Header1: value1\015\012"
                + "Header2  :   value 2a  \015\012"
                + "                    value 2b  \015\012"
                + "Header3: \015\012"
View Full Code Here

    }

    public void testChunkParse()
      throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput(
            "GET /chunk HTTP/1.0\015\012"
                + "Header1: value1\015\012"
        + "Transfer-Encoding: chunked\015\012"
                + "\015\012"
                + "a;\015\012"
View Full Code Here

    }

    public void testMultiParse()
    throws Exception
    {
        StringEndPoint io=new StringEndPoint();
        io.setInput(
            "GET /mp HTTP/1.0\015\012"
                + "Header1: value1\015\012"
        + "Transfer-Encoding: chunked\015\012"
                + "\015\012"
                + "a;\015\012"
View Full Code Here

TOP

Related Classes of org.mortbay.io.bio.StringEndPoint

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.