Examples of MockExternalContext


Examples of com.sun.faces.mock.MockExternalContext

         "com.sun.faces.mock.MockApplicationFactory");
  FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
         "com.sun.faces.mock.MockRenderKitFactory");

        externalContext =
            new MockExternalContext(servletContext, request, response);
        lifecycle = new MockLifecycle();
        facesContext = new MockFacesContext(externalContext, lifecycle);
        ApplicationFactory applicationFactory = (ApplicationFactory)
            FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        application = (MockApplication) applicationFactory.getApplication();
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockExternalContext

        ExceptionHandler exceptionHandler = ((ExceptionHandlerFactory)
                FactoryFinder.getFactory(FactoryFinder.EXCEPTION_HANDLER_FACTORY)).getExceptionHandler();
        this.facesContext.setExceptionHandler(exceptionHandler);

        ((MockFacesContext) this.facesContext).setExternalContext(
                new MockExternalContext(this.servletContext, this.request, this.response));
    }
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockExternalContext

        FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY, MockRenderKitFactory.class.getName());
    }

    protected void initExternalContext() throws Exception
    {
        externalContext = new MockExternalContext(servletContext, request, response);
    }
View Full Code Here

Examples of org.apache.myfaces.test.mock.MockExternalContext

       
        commandLink.setValue("outputdata");
       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "false");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
View Full Code Here

Examples of org.apache.myfaces.tobago.mock.faces.MockExternalContext

    ServletContext servletContext = new MockServletContext();
    HttpServletRequest request = new MockHttpServletRequest();
    HttpServletResponse response = new MockHttpServletResponse();
    pageContext = new MockPageContext(request);
    ExternalContext externalContext =
        new MockExternalContext(servletContext, request, response);
    Lifecycle lifecycle = null;
    facesContext = new MockFacesContext(externalContext, lifecycle);
    // Set up Faces API Objects
    FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
        "org.apache.myfaces.tobago.mock.faces.MockApplicationFactory");
View Full Code Here

Examples of org.apache.shale.test.mock.MockExternalContext

        FactoryFinder.releaseFactories();
        FactoryFinder.setFactory("javax.faces.application.ApplicationFactory", "org.apache.shale.test.mock.MockApplicationFactory");
        FactoryFinder.setFactory("javax.faces.context.FacesContextFactory", "org.apache.shale.test.mock.MockFacesContextFactory");
        FactoryFinder.setFactory("javax.faces.lifecycle.LifecycleFactory", "org.apache.shale.test.mock.MockLifecycleFactory");
        FactoryFinder.setFactory("javax.faces.render.RenderKitFactory", "org.apache.shale.test.mock.MockRenderKitFactory");
        externalContext = new MockExternalContext(servletContext, request, response);
        lifecycleFactory = (MockLifecycleFactory)FactoryFinder.getFactory("javax.faces.lifecycle.LifecycleFactory");
        lifecycle = (MockLifecycle)lifecycleFactory.getLifecycle("DEFAULT");
        facesContextFactory = (MockFacesContextFactory)FactoryFinder.getFactory("javax.faces.context.FacesContextFactory");
        facesContext = (MockFacesContext)facesContextFactory.getFacesContext(servletContext, request, response, lifecycle);
        externalContext = (MockExternalContext)facesContext.getExternalContext();
View Full Code Here

Examples of org.apache.shale.test.mock.MockExternalContext

        FactoryFinder.setFactory(FactoryFinder.LIFECYCLE_FACTORY,
                "org.apache.shale.test.mock.MockLifecycleFactory");
        FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
                "org.apache.shale.test.mock.MockRenderKitFactory");

        externalContext = new MockExternalContext(servletContext, request, response);
        lifecycleFactory = (MockLifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        lifecycle = (MockLifecycle) lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
        facesContextFactory = (MockFacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
        facesContext = (MockFacesContext)
                facesContextFactory.getFacesContext(servletContext, request, response, lifecycle);
View Full Code Here

Examples of org.jboss.seam.mock.MockExternalContext

      appContext.set( Seam.getComponentName(clazz) + ".component", new Component(clazz) );
   }
  
   private MockFacesContext createFacesContext()
   {
      ExternalContext externalContext = new MockExternalContext();
      MockFacesContext facesContext = new MockFacesContext( externalContext, new MockApplication() );
      facesContext.setCurrent().createViewRoot();
      facesContext.getApplication().setStateManager( new SeamStateManager( facesContext.getApplication().getStateManager() ) );
     
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      installComponents(appContext);
      return facesContext;
   }
View Full Code Here

Examples of org.jboss.seam.mock.MockExternalContext

         for (Map.Entry<String, String> param : params.entrySet())
         {
            request.getParameterMap().put(param.getKey(), new String[] { param.getValue() });
         }
      }
      ExternalContext extContext = new MockExternalContext(request);
      Application application = new MockApplication();
      application.addELResolver(new ImplicitObjectELResolver());
      FacesContext facesCtx = new MockFacesContext(extContext, application).setCurrent();
      assert FacesContext.getCurrentInstance() != null;
      return facesCtx;
View Full Code Here

Examples of org.jboss.seam.mock.MockExternalContext

      // start all the contexts
      Lifecycle.beginCall();

      // establish the FacesContext
      new MockFacesContext(new MockExternalContext(), new MockApplication()).setCurrent().createViewRoot();
      FacesLifecycle.resumePage();

      // install key components
      installComponents(Contexts.getApplicationContext());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.