Package org.apache.myfaces.test.mock

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


        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();
        String content2 = new String(writer2.content());
        Assert.assertTrue(content2.contains("Dynamically added markup"));
        int indexDynHeader2_1 = content2.indexOf("Start Dynamic Header");
        int indexDynHeader2_2 = content2.indexOf("Dynamically added header", indexDynHeader2_1);
        int indexDynHeader2_3 = content2.indexOf("End Dynamic Header", indexDynHeader2_2);
        Assert.assertNotSame(-1, indexDynHeader2_1);
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 writer3 = (MockPrintWriter) response.getWriter();
        String content3 = new String(writer3.content());
        Assert.assertTrue(content3.contains("Dynamically added markup"));
        int indexDynHeader3_1 = content3.indexOf("Start Dynamic Header");
        int indexDynHeader3_2 = content3.indexOf("Dynamically added header", indexDynHeader3_1);
        int indexDynHeader3_3 = content3.indexOf("End Dynamic Header", indexDynHeader3_2);
        Assert.assertNotSame(-1, indexDynHeader3_1);
View Full Code Here

       
        executeViewHandlerRender(facesContext);
        executeAfterRender(facesContext);
       
        MockPrintWriter writer1 = (MockPrintWriter) response.getWriter();       
        String content1 = new String(writer1.content());
        Assert.assertTrue(content1.contains("header_yellow"));
       
        endRequest();
       
        startViewRequest("/view_3.xhtml");
View Full Code Here

        Assert.assertTrue(contractsList.contains("red"));
       
        executeViewHandlerRender(facesContext);

        MockPrintWriter writer2 = (MockPrintWriter) response.getWriter();
        String content2 = new String(writer2.content());
        Assert.assertTrue(content2.contains("header_red"));
       
        executeAfterRender(facesContext);
       
        endRequest();
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

   
    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

        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");
        client.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"));

        endRequest();
    }
   
    @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");
        client.submit(button);
        processLifecycleExecuteAndRender();
       
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.