1 package com.sun.facelets.tag.ui; 2 3 import java.io.StringWriter ; 4 5 import javax.faces.component.UIViewRoot; 6 import javax.faces.context.FacesContext; 7 8 import com.sun.facelets.Facelet; 9 import com.sun.facelets.FaceletFactory; 10 import com.sun.facelets.FaceletTestCase; 11 import com.sun.facelets.mock.MockResponseWriter; 12 13 public class DefineIncludeTestCase extends FaceletTestCase { 14 15 public void testDefineInclude() throws Exception { 16 FacesContext faces = FacesContext.getCurrentInstance(); 17 18 FaceletFactory f = FaceletFactory.getInstance(); 19 Facelet at = f.getFacelet("defineInclude.xml"); 20 21 UIViewRoot root = faces.getViewRoot(); 22 at.apply(faces, root); 23 24 StringWriter sw = new StringWriter (); 25 MockResponseWriter mrw = new MockResponseWriter(sw); 26 faces.setResponseWriter(mrw); 27 root.encodeAll(faces); 28 sw.flush(); 29 30 System.out.println("************************"); 31 System.out.println(sw.toString()); 32 System.out.println("************************"); 33 } 34 35 } 36 | Popular Tags |