Package org.jboss.portletbridge

Examples of org.jboss.portletbridge.MockActionRequest


     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
     */
    public void setUp() throws Exception {
   super.setUp();
   portletContext=new MockPortletContext(servletContext);
   portletRequest = new MockActionRequest(portletContext);
   portletResponse = new MockActionResponse();
   PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
   PortletWindowState portletState = new PortletWindowState(){

  @Override
View Full Code Here


         * {@link org.jboss.portletbridge.context.FacesContextFactoryImpl#getFacesContext(java.lang.Object, java.lang.Object, java.lang.Object, javax.faces.lifecycle.Lifecycle)}.
         */
    public void testGetFacesContextPortlet() {
   FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
   MockPortletContext portletContext = new MockPortletContext(servletContext);
   MockActionRequest portletRequest = new MockActionRequest(portletContext);
   MockActionResponse portletResponse = new MockActionResponse();
   PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
   PortletWindowState portletState = new PortletWindowState(){

  @Override
  public BridgeConfig getBridgeConfig() {
    return new BridgeConfig(){

      public Map<String, String> getDefaultViewIdMap() {
        HashMap<String, String> viewIdMap = new HashMap<String,String>();
        viewIdMap.put("view", "/foo.xhtml");
        return viewIdMap;
      }

      public Set<ExcludedRequestAttribute> getExcludedAttributes() {
        // TODO Auto-generated method stub
        return null;
      }

      public List<String> getFacesServletMappings() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getInitParameter(String name) {
        // TODO Auto-generated method stub
        return null;
      }

      public PortletConfig getPortletConfig() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getPortletName() {
        // TODO Auto-generated method stub
        return null;
      }

      public boolean isPreserveActionParams() {
        // TODO Auto-generated method stub
        return false;
      }

      public Map<Class<? extends Throwable>, String> getErrorPages() {
        // TODO Auto-generated method stub
        return null;
      }

         public Lifecycle getFacesLifecycle() {
            return null;
         }

      };
  }
    
   };
   portletStateHolder.addWindowState(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = portletState.createBridgeContext();
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
   FacesContext context = factory.getFacesContext(portletContext,
      portletRequest, portletResponse, lifecycle);
   assertTrue((context instanceof FacesContextImpl));
   assertTrue((context.getExternalContext() instanceof AbstractExternalContext));
   assertSame(FacesContext.getCurrentInstance(),context);
View Full Code Here

         * {@link org.jboss.portletbridge.context.FacesContextFactoryImpl#getFacesContext(java.lang.Object, java.lang.Object, java.lang.Object, javax.faces.lifecycle.Lifecycle)}.
         */
    public void testGetFacesContextPortlet() {
   FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
   MockPortletContext portletContext = new MockPortletContext(servletContext);
   MockActionRequest portletRequest = new MockActionRequest(portletContext);
   MockActionResponse portletResponse = new MockActionResponse();
   RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
   BridgeRequestScope portletState = new BridgeRequestScope();
   portletStateHolder.saveRequestScope(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = new PortletBridgeContext(getBridgeConfig());
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
   portletRequest.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ACTION_PHASE);
   FacesContext context = factory.getFacesContext(portletContext,
      portletRequest, portletResponse, lifecycle);
   assertTrue((context instanceof FacesContextImpl));
   assertTrue((context.getExternalContext() instanceof AbstractExternalContext));
   assertSame(FacesContext.getCurrentInstance(),context);
View Full Code Here

     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
     */
    public void setUp() throws Exception {
   super.setUp();
   portletContext=new MockPortletContext(servletContext);
   portletRequest = new MockActionRequest(portletContext);
   portletResponse = new MockActionResponse();
   RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
   BridgeRequestScope portletState = new BridgeRequestScope(){
    
   };
View Full Code Here

TOP

Related Classes of org.jboss.portletbridge.MockActionRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.