Package org.apache.myfaces.test.mock

Examples of org.apache.myfaces.test.mock.MockResponseWriter


    {
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testJSPXProcessing1.jspx");

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);

        root.encodeAll(facesContext);

        sw.flush();
View Full Code Here


    {
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testXHTMLProcessing1.xhtml");

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);

        root.encodeAll(facesContext);

        sw.flush();
View Full Code Here

       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "test-tags.xml");
       
        FastWriter fw = new FastWriter();
        MockResponseWriter mrw = new MockResponseWriter(fw);
        facesContext.setResponseWriter(mrw);
        root.encodeAll(facesContext);
        //System.out.println(fw);
    }
View Full Code Here

        UIComponent panelGroup1 = root.findComponent("testGroup1");
        Assert.assertNotNull(panelGroup1);

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
        root.encodeAll(facesContext);
        sw.flush();
        Assert.assertTrue(sw.toString().contains(".myCustomStyle { background:red }"));
View Full Code Here

        UIComponent panelGroup1 = root.findComponent("testGroup1");
        Assert.assertNotNull(panelGroup1);

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
        root.encodeAll(facesContext);
        sw.flush();
        Assert.assertTrue(sw.toString().contains(".myCustomStyle { background:red }"));
View Full Code Here

        return new TestSuite(HtmlButtonRendererTest.class);
    }

    public void setUp() throws Exception {
        super.setUp();
        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);
        commandButton = new HtmlCommandButton();
        form = new HtmlForm();
        commandButton.setParent(form);
       
View Full Code Here

    {
        super.setUp();

        body = new HtmlBody();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.getRenderKit().addRenderer(
                body.getFamily(),
View Full Code Here

        super.setUp();

        outputText = new HtmlOutputText();
        inputText = new HtmlInputText();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);
        // TODO remove these two lines once myfaces-test goes alpha, see MYFACES-1155
        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.getRenderKit().addRenderer(
                outputText.getFamily(),
View Full Code Here

        Assert.assertNotNull(compositeComponent);
        UIOutput text = (UIOutput) compositeComponent.getFacet(UIComponent.COMPOSITE_FACET_NAME).findComponent("text");
        Assert.assertNotNull(text);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
        compositeComponent.encodeAll(facesContext);
        sw.flush();
       
View Full Code Here

        text2.popComponentFromEL(facesContext);
        facet2.popComponentFromEL(facesContext);
        compositeComponent2.popComponentFromEL(facesContext);

        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
       
        compositeComponent1.encodeAll(facesContext);
        sw.flush();
       
View Full Code Here

TOP

Related Classes of org.apache.myfaces.test.mock.MockResponseWriter

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.