System.out.println("ApplicationImpl:" + facesContext.getApplication().getClass().getName());
System.out.println("ExpressionFactory:" + facesContext.getApplication().getExpressionFactory().getClass().getName());
vdl.buildView(facesContext, root, "test1.xml");
FastWriter fw = new FastWriter();
ResponseWriter rw = facesContext.getResponseWriter();
rw = rw.cloneWithWriter(fw);
facesContext.setResponseWriter(rw);
root.encodeAll(facesContext);
String result = fw.toString();
Assert.assertTrue("Output:" + result, result.contains("<p>Component value:page test2</p>"));
Assert.assertTrue("Output:" + result,result.contains("<p>Inline EL value: page test2</p>"));
//System.out.println(fw);
ComponentSupport.removeTransient(root);
request.setAttribute("test", "test3.xml");
facesContext.setViewRoot(facesContext.getApplication().getViewHandler()
.createView(facesContext, "/test"));
root = facesContext.getViewRoot();
vdl.buildView(facesContext, root, "test1.xml");
fw = new FastWriter();
rw = facesContext.getResponseWriter();
rw = rw.cloneWithWriter(fw);
facesContext.setResponseWriter(rw);
root.encodeAll(facesContext);
rw.flush();
//System.out.println(fw);
result = fw.toString();
Assert.assertTrue("Output:" + result, result.contains("<p>Component value:page test3</p>"));
Assert.assertTrue("Output:" + result, result.contains("<p>Inline EL value: page test3</p>"));
}