1 5 package org.exoplatform.test.mocks.portlet; 6 7 import javax.portlet.* ; 8 import javax.faces.context.FacesContext ; 9 import org.exoplatform.test.mocks.jsf.*; 10 11 17 public class MockPortletFacesContext extends MockFacesContext { 18 19 20 public MockPortletFacesContext() { 21 externalContext_ = new MockPortletExternalContext(); 22 } 23 24 public PortletPreferences getPortletPreferences() { 25 return ((MockPortletExternalContext) externalContext_).getPortletPreferences() ; 26 } 27 28 public MockPortletConfig getMockPortletConfig() { 29 return ((MockPortletExternalContext) externalContext_).getMockPortletConfig() ; 30 } 31 32 public MockPortletContext getMockPortletContext() { 33 return ((MockPortletExternalContext) externalContext_).getMockPortletContext() ; 34 } 35 36 public static MockPortletFacesContext getMockPortletFacesContextCurrentInstance() { 37 MockPortletFacesContext context = (MockPortletFacesContext)FacesContext.getCurrentInstance() ; 38 if(context == null) { 39 context= new MockPortletFacesContext() ; 40 FacesContext.setCurrentInstance(context) ; 41 } 42 return context ; 43 } 44 } 45 | Popular Tags |