Package com.sun.facelets

Examples of com.sun.facelets.Facelet


public class TestNbsp extends FaceletTestCase {

    public void testNbsp() throws Exception {
        FaceletFactory ff = FaceletFactory.getInstance();
        Facelet f = ff.getFacelet("nbsp.xml");
        FacesContext faces = FacesContext.getCurrentInstance();
        UIViewRoot root = new UIViewRoot();
        f.apply(faces, root);
       
        PrintWriter pw = new PrintWriter(System.out);
        MockResponseWriter rw = new MockResponseWriter(pw);
        faces.setResponseWriter(rw);
       
View Full Code Here


public class SelectTestCase extends FaceletTestCase {

  public void testSelectOne() throws Exception {
    FaceletFactory ff = FaceletFactory.getInstance();
    Facelet f = ff.getFacelet("selectOne.xml");
    this.servletRequest.getSession().setAttribute("test", new TestBean());
    this.servletRequest.setParameter("testForm:alignment", "10");
    FacesContext faces = FacesContext.getCurrentInstance();
    UIViewRoot root = new UIViewRoot();
    f.apply(faces, root);
    UISelectOne one = (UISelectOne) root.findComponent("testForm:alignment");
    root.processDecodes(faces);
    root.processValidators(faces);
    System.out.println(faces.getMessages().hasNext());
  }
View Full Code Here

import com.sun.facelets.util.FastWriter;

public class IncludeParamTestCase extends FaceletTestCase {

    public void testCaching() throws Exception {
        Facelet f = FaceletFactory.getInstance().getFacelet("test1.xml");
       
       
        FacesContext faces = FacesContext.getCurrentInstance();
       
        UIViewRoot root = faces.getViewRoot();
       
        this.servletRequest.setAttribute("test", "test2.xml");
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
        root.encodeAll(faces);
        System.out.println(fw);
       
        ComponentSupport.removeTransient(root);
       
        this.servletRequest.setAttribute("test", "test3.xml");
        f.apply(faces, root);
       
        fw = new FastWriter();
        rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

import com.sun.facelets.util.FastWriter;

public class TemplateTestCase extends FaceletTestCase {

    public void testOutput() throws Exception {
        Facelet f = FaceletFactory.getInstance().getFacelet("s_page.xhtml");
        FacesContext faces = FacesContext.getCurrentInstance();
       
        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

    public void testRelativePaths() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("parent.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
View Full Code Here

   
    public void testCompositionTemplate() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
View Full Code Here

   
    public void testCompositionTemplateSimple() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template-simple.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
View Full Code Here

        FacesContext faces = FacesContext.getCurrentInstance();
        Map map = new HashMap();
        faces.getExternalContext().getRequestMap().put("map", map);

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("component.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("only one child, the component", 1, root.getChildCount());
        assertNotNull("bound to map", map.get("c"));
    }
View Full Code Here

        FacesContext faces = FacesContext.getCurrentInstance();
        Map map = new HashMap();
        faces.getExternalContext().getRequestMap().put("map", map);

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("component-client.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("4 children, the component", 4, root.getChildCount());
        assertNotNull("bound to map", map.get("c"));
    }
View Full Code Here

    public void testDefineInclude() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("defineInclude.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
View Full Code Here

TOP

Related Classes of com.sun.facelets.Facelet

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.