1 /***************************************************************************2 * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *3 * Please look at license.txt in info directory for more license detail. *4 **************************************************************************/5 package org.exoplatform.test.mocks.jsf;6 7 import java.io.IOException ;8 import java.util.List ;9 10 import javax.faces.component.UIComponent;11 import javax.faces.component.UIViewRoot;12 import javax.faces.context.FacesContext;13 import javax.faces.context.ResponseWriter;14 import javax.faces.render.RenderKitFactory;15 /**16 * Apr 12, 200417 * @author: Tuan Nguyen18 * @email: tuan08@users.sourceforge.net19 * @version: $Id: MockUIViewRoot.java,v 1.1 2004/10/11 23:27:25 tuan08 Exp $20 **/21 public class MockUIViewRoot extends UIViewRoot {22 23 public void encodeBegin(FacesContext context) throws IOException {24 25 }26 27 public void encodeChildren(FacesContext context) throws IOException {28 29 }30 31 public void encodeEnd(FacesContext context) throws IOException {32 ResponseWriter w = context.getResponseWriter() ;33 //w.write("<html><body>") ;34 List children = getChildren() ;35 for (int i = 0 ; i < children.size() ; i++) {36 UIComponent child = (UIComponent)children.get(i) ;37 child.encodeBegin(context) ;38 child.encodeChildren(context) ;39 child.encodeEnd(context) ;40 }41 //w.write("</body></html>") ;42 }43 44 public String getRenderKitId() {45 return RenderKitFactory.HTML_BASIC_RENDER_KIT ;46 }47 }