Package org.apache.myfaces.test.mock

Examples of org.apache.myfaces.test.mock.MockPrintWriter.content()


   
    protected String getRenderedContent(FacesContext facesContext) throws IOException
    {
        MockPrintWriter writer1 = (MockPrintWriter)
            (((HttpServletResponse) facesContext.getExternalContext().getResponse()).getWriter());
        return String.valueOf(writer1.content());
    }

    // ------------------------------------------------------ Instance Variables

View Full Code Here


   
    public String getRenderedContent(FacesContext facesContext) throws IOException
    {
        MockPrintWriter writer1 = (MockPrintWriter) (((HttpServletResponse)
            facesContext.getExternalContext().getResponse()).getWriter());
        return String.valueOf(writer1.content());
    }

    public MockServletConfig getServletConfig()
    {
        return servletConfig;
View Full Code Here

    }
   
    protected String getRenderedContent(FacesContext facesContext) throws IOException
    {
        MockPrintWriter writer1 = (MockPrintWriter) (((HttpServletResponse) facesContext.getExternalContext().getResponse()).getWriter());
        return String.valueOf(writer1.content());
    }

    // ------------------------------------------------------ Instance Variables

View Full Code Here

        Assert.assertEquals(1, comp.getChildCount());
        UIComponent wrapper = comp.getChildren().get(0);
        Assert.assertEquals(2, wrapper.getChildCount());
        Assert.assertEquals("Dynamically added child", wrapper.getChildren().get(1).getAttributes().get("value"));
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer1.content()).contains("Dynamically added markup"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
View Full Code Here

        Assert.assertEquals(1, comp.getChildCount());
        wrapper = comp.getChildren().get(0);
        Assert.assertEquals(2, wrapper.getChildCount());
        Assert.assertEquals("Dynamically added child", wrapper.getChildren().get(1).getAttributes().get("value"));
        MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer2.content()).contains("Dynamically added markup"));

        tearDownRequest();
    }
   
    @Test
View Full Code Here

        Assert.assertEquals(1, comp.getChildCount());
        UIComponent wrapper = comp.getChildren().get(0);
        Assert.assertEquals(2, wrapper.getChildCount());
        Assert.assertEquals("Dynamically added child", wrapper.getChildren().get(1).getAttributes().get("value"));
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer1.content()).contains("Dynamically added markup"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
View Full Code Here

        Assert.assertEquals(1, comp.getChildCount());
        wrapper = comp.getChildren().get(0);
        Assert.assertEquals(2, wrapper.getChildCount());
        Assert.assertEquals("Dynamically added child", wrapper.getChildren().get(1).getAttributes().get("value"));
        MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer2.content()).contains("Dynamically added markup"));

        tearDownRequest();
    }
   
    @Test
View Full Code Here

        Assert.assertEquals(3, ccContent.getChildCount());
        Assert.assertEquals("Dynamically added header",
            ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));       
        Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer1.content()).contains("Dynamically added markup"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
        processLifecycleExecuteAndRender();
       
View Full Code Here

        Assert.assertEquals(3, ccContent.getChildCount());
        Assert.assertEquals("Dynamically added header",
            ccContent.getChildren().get(0).getFacet("header").getAttributes().get("value"));       
        Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
        MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
        Assert.assertTrue(new String(writer2.content()).contains("Dynamically added markup"));

        tearDownRequest();
    }

    @Test
View Full Code Here

        UIComponent ccContent = wrapper.getFacet(UIComponent.COMPOSITE_FACET_NAME);
        Assert.assertNotNull(ccContent);
        Assert.assertEquals(3, ccContent.getChildCount());
        Assert.assertEquals("Dynamically added child", ccContent.getChildren().get(2).getAttributes().get("value"));
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();
        String content1 = new String(writer1.content());
        Assert.assertTrue(content1.contains("Dynamically added header"));
        Assert.assertTrue(content1.contains("Dynamically added markup"));
       
        UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:postback");
        submit(button);
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.