Package com.sun.facelets

Examples of com.sun.facelets.Facelet


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

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

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIInput input = (UIInput) root.findComponent("form:input");
       
        assertNotNull("input", input);
       
View Full Code Here


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

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

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIInput input = (UIInput) root.findComponent("form:input");
       
        assertNotNull("input", input);
       
View Full Code Here

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

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

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIInput input = (UIInput) root.findComponent("form:input");
       
        assertNotNull("input", input);
       
View Full Code Here

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

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

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("german locale", Locale.GERMAN, root.getLocale());
    }
View Full Code Here

import com.sun.facelets.util.FastWriter;

public class DataTableTestCase extends FaceletTestCase {

    public void testDataTable() throws Exception {
Facelet f = FaceletFactory.getInstance().getFacelet("dataTable.xml");
       
        FacesContext faces = FacesContext.getCurrentInstance();
        faces.getExternalContext().getRequestMap().put("company", Example.createCompany());
       
       
        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 testCommandComponent() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
        this.servletRequest.getSession().setAttribute("test", new TestBean());

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("componentOwner.xml");
       
        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIComponent c = root.findComponent("cmd");
        assertNotNull("cmd", c);
       
        Object v = c.getAttributes().get("id");
View Full Code Here

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

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("commandButton.xml");
       
        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        UIComponent c = root.findComponent("form:button");
        assertNotNull("button", c);
       
        Object v = c.getAttributes().get("id");
View Full Code Here

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

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

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

        Map session = faces.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("if.xml");
       
        UIViewRoot root = faces.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        at.apply(faces, root);
        UIComponent c = root.findComponent("form");
        assertNotNull("form is null", c);
       
        // now make sure it isn't
        e.setManagement(false);
        at.apply(faces, root);
        c = root.findComponent("form");
        assertNull("form is not null", c);
    }
View Full Code Here

        for (int i = 0; i < 10; i++) {
            m.put("" + i, "" + i);
        }
       
        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("forEach.xml");
       
        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        MockResponseWriter mrw = new MockResponseWriter(fw);
        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.