KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > TemplateClientTestCase


1 package com.sun.facelets;
2
3 import javax.faces.component.UIViewRoot;
4 import javax.faces.context.FacesContext;
5
6 import com.sun.facelets.mock.MockResponseWriter;
7 import com.sun.facelets.util.FastWriter;
8
9 public class TemplateClientTestCase extends FaceletTestCase {
10
11     public void testClientClient() throws Exception JavaDoc {
12         FaceletFactory ff = FaceletFactory.getInstance();
13         FacesContext faces = FacesContext.getCurrentInstance();
14         
15         Facelet f = ff.getFacelet("template-client-client.xhtml");
16         
17         this.servletRequest.setAttribute("name", "Mr. Hookom");
18         
19         UIViewRoot root = faces.getViewRoot();
20         f.apply(faces, root);
21         
22         FastWriter fw = new FastWriter();
23         MockResponseWriter mrw = new MockResponseWriter(fw);
24         faces.setResponseWriter(mrw);
25         root.encodeAll(faces);
26         System.out.println(fw);
27     }
28     
29     /*
30     public void testLayoutClient() throws Exception {
31         FaceletFactory ff = FaceletFactory.getInstance();
32         FacesContext faces = FacesContext.getCurrentInstance();
33         
34         Facelet f = ff.getFacelet("layout-client.xhtml");
35         
36         this.servletRequest.setAttribute("name", "Mr. Hookom");
37         
38         UIViewRoot root = faces.getViewRoot();
39         f.apply(faces, root);
40         
41         FastWriter fw = new FastWriter();
42         MockResponseWriter mrw = new MockResponseWriter(fw);
43         faces.setResponseWriter(mrw);
44         root.encodeAll(faces);
45         System.out.println(fw);
46     }
47     */

48    
49
50 }
51
Popular Tags