1 package com.sun.facelets; 2 3 import javax.faces.component.UIViewRoot; 4 import javax.faces.context.FacesContext; 5 import javax.faces.context.ResponseWriter; 6 7 import com.sun.facelets.mock.MockResponseWriter; 8 import com.sun.facelets.util.FastWriter; 9 10 public class InstructionsTestCase extends FaceletTestCase { 11 12 public void testInstructions() throws Exception { 13 Facelet f = FaceletFactory.getInstance().getFacelet("instructions.xhtml"); 14 15 FacesContext faces = FacesContext.getCurrentInstance(); 16 UIViewRoot root = faces.getViewRoot(); 17 f.apply(faces, root); 18 19 FastWriter fw = new FastWriter(); 20 ResponseWriter rw = faces.getResponseWriter(); 21 rw = rw.cloneWithWriter(fw); 22 faces.setResponseWriter(rw); 23 root.encodeAll(faces); 24 System.out.println(fw); 25 } 26 27 } 28 | Popular Tags |