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"));