Package com.alibaba.citrus.util.internal.webpagelite

Examples of com.alibaba.citrus.util.internal.webpagelite.RequestContext


        page = new MyProcessor();
    }

    @Test
    public void requestContext_getWriter() throws IOException {
        RequestContext context = new MyRequest("http://localhost", "/dummy.txt");

        try {
            context.getWriter();
            fail();
        } catch (IllegalStateException e) {
            assertThat(e, exception("call getWriter(contentType) first"));
        }

        PrintWriter writer = context.getWriter("text/plain");

        assertSame(writer, context.getWriter());
        assertSame(writer, context.getWriter("text/plain"));
    }
View Full Code Here


        assertSame(writer, context.getWriter("text/plain"));
    }

    @Test
    public void requestContext_getOutputStream() throws IOException {
        RequestContext context = new MyRequest("http://localhost", "/dummy.txt");

        try {
            context.getOutputStream();
            fail();
        } catch (IllegalStateException e) {
            assertThat(e, exception("call getOutputStream(contentType) first"));
        }

        OutputStream stream = context.getOutputStream("text/plain");

        assertSame(stream, context.getOutputStream());
        assertSame(stream, context.getOutputStream("text/plain"));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.util.internal.webpagelite.RequestContext

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.