Package org.apache.myfaces.view.facelets.util

Examples of org.apache.myfaces.view.facelets.util.FastWriter


        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0_8");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        try
View Full Code Here


        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat1");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
        Assert.assertNotSame(-1, itemIndex2);
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat1_7");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
        Assert.assertNotSame(-1, itemIndex2);
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat1_8");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        try
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset2.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
        Assert.assertEquals(-1, itemIndex2);
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static String writeDebugOutput(FacesContext faces) throws IOException
    {
        FastWriter fw = new FastWriter();
        ErrorPageWriter.debugHtml(fw, faces);

        Map<String, Object> session = faces.getExternalContext().getSessionMap();
        Map<String, String> debugs = (Map<String, String>) session.get(KEY);
        if (debugs == null)
        {
            debugs = new LinkedHashMap<String, String>()
            {
                protected boolean removeEldestEntry(Entry<String, String> eldest)
                {
                    return (this.size() > 5);
                }
            };
           
            session.put(KEY, debugs);
        }
       
        String id = String.valueOf(nextId++);
       
        debugs.put(id, fw.toString());
       
        return id;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private static String writeDebugOutput(FacesContext faces) throws IOException
    {
        FastWriter fw = new FastWriter();
        ErrorPageWriter.debugHtml(fw, faces);

        Map<String, Object> session = faces.getExternalContext().getSessionMap();
        Map<String, String> debugs = (Map<String, String>) session.get(KEY);
        if (debugs == null)
        {
            debugs = new LinkedHashMap<String, String>()
            {
                protected boolean removeEldestEntry(Entry<String, String> eldest)
                {
                    return (this.size() > 5);
                }
            };
           
            session.put(KEY, debugs);
        }
       
        String id = String.valueOf(nextId++);
       
        debugs.put(id, fw.toString());
       
        return id;
    }
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();

        // install the FastWriter
        _writer = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(_writer);
        facesContext.setResponseWriter(rw);
    }
View Full Code Here

        facesContext.getExternalContext().getRequestMap().put("company", c);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "repeat.xml");
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
        root.encodeAll(facesContext);
        String content = fw.toString();
       
        int hrIndex = content.indexOf("<dt>HR</dt>");
        Assert.assertNotSame(-1, hrIndex);
        int rdIndex = content.indexOf("<dt>RD</dt>", hrIndex);
        Assert.assertNotSame(-1, rdIndex);
View Full Code Here

        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
        String content = fw.toString();
       
        // offset="2" size="1" should render only 1 row
        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
        int itemIndex2 = content.indexOf("B2");
View Full Code Here

TOP

Related Classes of org.apache.myfaces.view.facelets.util.FastWriter

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.