Package com.sun.facelets

Source Code of com.sun.facelets.TemplateClientTestCase

package com.sun.facelets;

import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;

import com.sun.facelets.mock.MockResponseWriter;
import com.sun.facelets.util.FastWriter;

public class TemplateClientTestCase extends FaceletTestCase {

    public void testClientClient() throws Exception {
        FaceletFactory ff = FaceletFactory.getInstance();
        FacesContext faces = FacesContext.getCurrentInstance();
       
        Facelet f = ff.getFacelet("template-client-client.xhtml");
       
        this.servletRequest.setAttribute("name", "Mr. Hookom");
       
        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        MockResponseWriter mrw = new MockResponseWriter(fw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
        System.out.println(fw);
    }
   
    /*
    public void testLayoutClient() throws Exception {
        FaceletFactory ff = FaceletFactory.getInstance();
        FacesContext faces = FacesContext.getCurrentInstance();
       
        Facelet f = ff.getFacelet("layout-client.xhtml");
       
        this.servletRequest.setAttribute("name", "Mr. Hookom");
       
        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        MockResponseWriter mrw = new MockResponseWriter(fw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
        System.out.println(fw);
    }
    */
  

}
TOP

Related Classes of com.sun.facelets.TemplateClientTestCase

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.