Examples of HttpDataReceiverMockup


Examples of org.apache.http.mockup.HttpDataReceiverMockup

        for (int i = 0; i < teststrs.length; i++) {
            expWrited += (teststrs[i].length() + 2/*CRLF*/);
        }
        assertEquals(expWrited, writedBytes);
       
        HttpDataReceiverMockup receiver = new HttpDataReceiverMockup(
            transmitter.getData(), 1024);

        for (int i = 0; i < teststrs.length; i++) {
            assertEquals(teststrs[i], receiver.readLine());
        }
        assertNull(receiver.readLine());
        assertNull(receiver.readLine());
        long readedBytes = receiver.getMetrics().getBytesTransferred();
        assertEquals(expWrited, readedBytes);
    }
View Full Code Here
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.