Package org.apache.myfaces.view.facelets.bean

Examples of org.apache.myfaces.view.facelets.bean.Employee


   
    @Test
    public void testIf1() throws Exception
    {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
              
       
        // now make sure it isn't
        e.setManagement(false);
       
        //facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
        //        .createView(facesContext, "/test"));
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
View Full Code Here


   
    @Test
    public void testIf2() throws Exception
    {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(false);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNull("form is not null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
        //facesContext.getAttributes().remove(root);
       
        //rebuild if.xml but with form present now
        e.setManagement(true);
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
        c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        // start and end shouldn't be in the component tree
View Full Code Here

   
    @Test
    public void testIf3() throws Exception
    {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if3.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        Assert.assertNotNull(c.getFacet("header"));
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
        //facesContext.getAttributes().remove(root);
       
        //rebuild if.xml but with form present now
        e.setManagement(false);
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if3.xhtml");
        c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        Assert.assertNull(c.getFacet("header"));
View Full Code Here

    }
   
    @Test
    public void testIf() throws Exception {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if.xml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
       
        // now make sure it isn't
        e.setManagement(false);
       
        facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
                .createView(facesContext, "/test"));
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if.xml");
View Full Code Here

    public void testIf1() throws Exception
    {
        facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
       
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
              
       
        // now make sure it isn't
        e.setManagement(false);
       
        //facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
        //        .createView(facesContext, "/test"));
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
View Full Code Here

    public void testIf2() throws Exception
    {
        facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
       
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(false);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNull("form is not null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
        //facesContext.getAttributes().remove(root);
       
        //rebuild if.xml but with form present now
        e.setManagement(true);
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
        c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        // start and end shouldn't be in the component tree
View Full Code Here

    public void testIf3() throws Exception
    {
        facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
       
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if3.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        Assert.assertNotNull(c.getFacet("header"));
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
        //facesContext.getAttributes().remove(root);
       
        //rebuild if.xml but with form present now
        e.setManagement(false);
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if3.xhtml");
        c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        Assert.assertNull(c.getFacet("header"));
View Full Code Here

    }
   
    @Test
    public void testIf() throws Exception {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if.xml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
       
        // now make sure it isn't
        e.setManagement(false);
       
        facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
                .createView(facesContext, "/test"));
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if.xml");
View Full Code Here

   
    @Test
    public void testIf1() throws Exception
    {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(true);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
              
       
        // now make sure it isn't
        e.setManagement(false);
       
        //facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
        //        .createView(facesContext, "/test"));
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
View Full Code Here

   
    @Test
    public void testIf2() throws Exception
    {
        Map session = facesContext.getExternalContext().getSessionMap();
        Employee e = new Employee();
        session.put("employee", e);

        UIViewRoot root = facesContext.getViewRoot();

        // make sure the form is there
        e.setManagement(false);
        vdl.buildView(facesContext, root,"if2.xhtml");
        UIComponent c = root.findComponent("form");
        Assert.assertNull("form is not null", c);
        c = root.findComponent("start");
        Assert.assertNotNull("start is null", c);
        c = root.findComponent("end");
        Assert.assertNotNull("end is null", c);
        //facesContext.getAttributes().remove(root);
       
        //rebuild if.xml but with form present now
        e.setManagement(true);
        root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root,"if2.xhtml");
        c = root.findComponent("form");
        Assert.assertNotNull("form is null", c);
        // start and end shouldn't be in the component tree
View Full Code Here

TOP

Related Classes of org.apache.myfaces.view.facelets.bean.Employee

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.