Package org.jboss.seam.mock

Examples of org.jboss.seam.mock.MockServletContext


public class InitializationTest
{
   @Test
   public void testInitialization()
   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      new Initialization(servletContext).create().init();

      assert !servletContext.getAttributes().isEmpty();
      assert servletContext.getAttributes().containsKey( Seam.getComponentName(Manager.class) + ".component" );
      assert servletContext.getAttributes().containsKey( Seam.getComponentName(Foo.class) + ".component" );
      assert !Contexts.isApplicationContextActive();
      ServletLifecycle.endApplication();
   }
View Full Code Here


    * Configuration for ConfigurableComponent is defined in ConfigurableComponent.component.xml
    */
   @Test
   public void testEnumPropertyAssignment()
   {
       MockServletContext servletContext = new MockServletContext();
       ServletLifecycle.beginApplication(servletContext);
       new Initialization( servletContext ).create().init();

       Lifecycle.beginCall();

View Full Code Here

   }
  
   @Test
   public void testEntityHomeConfiguration()
   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      new Initialization( servletContext ).create().init();
      Lifecycle.beginCall();
      Contexts.getEventContext().set(Seam.getComponentName(Transaction.class), new NoTransaction());
      MyEntityHome myEntityHome = (MyEntityHome) Component.getInstance("myEntityHome");
View Full Code Here

        ELContext elContext = EL.createELContext();
        SeamELResolver seamVariableResolver = new SeamELResolver();
        // org.jboss.seam.bpm.SeamVariableResolver jbpmVariableResolver = new
        // org.jboss.seam.bpm.SeamVariableResolver();

        MockServletContext servletContext = new MockServletContext();
        ServletLifecycle.beginApplication(servletContext);
        MockExternalContext externalContext = new MockExternalContext(
                servletContext);
        Context appContext = new ApplicationContext(externalContext
                .getApplicationMap());
View Full Code Here

    }

    @Test
    public void testContexts() {
        MockServletContext servletContext = new MockServletContext();
        ServletLifecycle.beginApplication(servletContext);
        MockHttpSession session = new MockHttpSession(servletContext);
        MockHttpServletRequest request = new MockHttpServletRequest(session);
        final ExternalContext externalContext = new MockExternalContext(
                servletContext, request);
View Full Code Here

public abstract class MockContainerTest
{
   @BeforeMethod
   protected void setUp()
   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new ApplicationContext(externalContext.getApplicationMap());
      installComponent(appContext, Manager.class);
      for (Class c : getComponentsToInstall())
View Full Code Here

{
   @BeforeMethod
   protected void setUp()
   {
      Lifecycle.beginApplication(new HashMap<String, Object>());
      new Initialization(new MockServletContext()).create().init();
      Lifecycle.setupApplication();
      installComponent(Contexts.getApplicationContext(), Actor.class);
      installComponent(Contexts.getApplicationContext(), PooledTaskInstanceList.class);
      installComponent(Contexts.getApplicationContext(), MockRolledBackTransaction.class);
      Lifecycle.beginCall();
View Full Code Here

      {
         servletContext = ServletLifecycle.getCurrentServletContext();
      }
      else
      {
         this.servletContext = new MockServletContext();
      }
   }
View Full Code Here

      {
         servletContext = ServletLifecycle.getServletContext();
      }
      else
      {
         this.servletContext = new MockServletContext();
      }
   }
View Full Code Here

   public void testContextManagement() throws Exception
   {
      SeamELResolver seamVariableResolver = new SeamELResolver();
      //org.jboss.seam.bpm.SeamVariableResolver jbpmVariableResolver = new org.jboss.seam.bpm.SeamVariableResolver();
     
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      //appContext.set( Seam.getComponentName(Init.class), new Init() );
      installComponent(appContext, ConversationEntries.class);
View Full Code Here

TOP

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

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.