Package org.apache.http.mockup

Examples of org.apache.http.mockup.ReadableByteChannelMockup


            // expected
        }
    }
   
    public void testZeroLengthDecoding() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here


            reader.close();
        }
    }

    public void testBasicDecoding() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff;", "more stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

        assertTrue(decoder.isCompleted());
        assertEquals(16, metrics.getBytesTransferred());
    }
   
    public void testCodingBeyondContentLimit() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {
                        "stuff;",
                        "more stuff; and a lot more stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
View Full Code Here

        assertTrue(decoder.isCompleted());
        assertEquals(16, metrics.getBytesTransferred());
    }

    public void testBasicDecodingSmallBuffer() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff;", "more stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

        assertTrue(decoder.isCompleted());
        assertEquals(16, metrics.getBytesTransferred());
    }
   
    public void testDecodingFromSessionBuffer1() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff;", "more stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

        assertTrue(decoder.isCompleted());
        assertEquals(10, metrics.getBytesTransferred());
    }

    public void testDecodingFromSessionBuffer2() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {
                        "stuff;",
                        "more stuff; and a lot more stuff"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
View Full Code Here

        assertTrue(decoder.isCompleted());
        assertEquals(0, metrics.getBytesTransferred());
    }

    public void testBasicDecodingFile() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

       
        fileHandle.delete();
    }
   
    public void testDecodingFileWithBufferedSessionData() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

       
        fileHandle.delete();
    }
   
    public void testDecodingFileWithOffsetAndBufferedSessionData() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

       
        fileHandle.delete();
    }
   
    public void testWriteBeyondFileSize() throws Exception {
        ReadableByteChannel channel = new ReadableByteChannelMockup(
                new String[] {"a"}, "US-ASCII");
        HttpParams params = new BasicHttpParams();
       
        SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
        HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
View Full Code Here

TOP

Related Classes of org.apache.http.mockup.ReadableByteChannelMockup

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.