Package org.jboss.seam.mock

Examples of org.jboss.seam.mock.MockExternalContext


  
   @Test
   public void testConversationInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
View Full Code Here


  
   @Test
   public void testConversationalInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
View Full Code Here

  
   @Test
   public void testValidationInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      ExternalContext externalContext = new MockExternalContext(servletContext);
      new MockFacesContext( externalContext, new MockApplication() ).setCurrent().createViewRoot();
     
      Context appContext = new FacesApplicationContext(externalContext);
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
View Full Code Here

  
   @Test
   public void testRemoveInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
View Full Code Here

      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 FacesApplicationContext(externalContext);
View Full Code Here

         Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
        
         // If a FacesContext isn't available, set one up
         if (FacesContext.getCurrentInstance() == null)
         {
            MockFacesContext mockFacesContext = new MockFacesContext(new MockExternalContext())
                     .setCurrent();
            mockFacesContext.createViewRoot();
         }
        
         FacesContext facesContext = FacesContext.getCurrentInstance();
View Full Code Here

      }
   }
  
   private MockFacesContext createFacesContext(HttpServletRequest request, HttpServletResponse response)
   {
      return new MockFacesContext( new MockExternalContext(getServletContext(), request, response), new MockApplication() );
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.mock.MockExternalContext

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.