Package com.mockrunner.mock.web

Examples of com.mockrunner.mock.web.MockServletInputStream


        request.setRequestURI("/geoserver/hello");
        request.setMethod("post");

        String body = "<Hello service=\"hello\"/>";

        MockServletInputStream input = new MockServletInputStream(body.getBytes());

        Dispatcher dispatcher = new Dispatcher();

        BufferedReader buffered = new BufferedReader(new InputStreamReader(input));
        buffered.mark(2048);
View Full Code Here


        request.setRequestURI("/geoserver/hello");
        request.setMethod("post");

        String body = "<Hello service=\"hello\"/>";

        MockServletInputStream input = new MockServletInputStream(body.getBytes());

        Dispatcher dispatcher = new Dispatcher();

        BufferedReader buffered = new BufferedReader(new InputStreamReader(input));
        buffered.mark(2048);
View Full Code Here

public class MonitorServletRequestTest extends TestCase {

   
    public void testInputStream() throws Exception {
        byte[] data = data();
        MockServletInputStream mock = new MockServletInputStream(data);
       
        MonitorInputStream in = new MonitorInputStream(mock);
        byte[] read = read(in);
       
        assertEquals(data.length, read.length);
View Full Code Here

public class MonitorServletRequestTest {

    @Test
    public void testInputStreamMaxSizeZero() throws Exception {
        byte[] data = data();
        MockServletInputStream mock = new MockServletInputStream(data);

        MonitorInputStream in = new MonitorInputStream(mock, 0);
        byte[] read = read(in);

        assertEquals(data.length, read.length);
View Full Code Here

    }
   
    @Test
    public void testInputStream() throws Exception {
        byte[] data = data();
        MockServletInputStream mock = new MockServletInputStream(data);
       
        MonitorInputStream in = new MonitorInputStream(mock, 1024);
        byte[] read = read(in);
       
        assertEquals(data.length, read.length);
View Full Code Here

        request.setRequestURI("/geoserver/hello");
        request.setMethod("post");

        String body = "<Hello service=\"hello\"/>";

        MockServletInputStream input = new MockServletInputStream(body.getBytes());

        Dispatcher dispatcher = new Dispatcher();

        BufferedReader buffered = new BufferedReader(new InputStreamReader(input));
        buffered.mark(2048);
View Full Code Here

TOP

Related Classes of com.mockrunner.mock.web.MockServletInputStream

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.