Examples of WebXmlBasedContextLoader


Examples of org.impalaframework.web.spring.loader.WebXmlBasedContextLoader

  private ModuleManagementFacade facade;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    contextLoader = new WebXmlBasedContextLoader();
    servletContext = createMock(ServletContext.class);
    facade = createMock(ModuleManagementFacade.class);
  }
View Full Code Here

Examples of org.impalaframework.web.spring.loader.WebXmlBasedContextLoader

        "context1.xml, context2.xml");
    expect(servletContext.getInitParameter(WebConstants.ROOT_MODULE_NAME_PARAM)).andReturn(
      "project1,project2");
    expect(servletContext.getInitParameter(WebConstants.MODULE_NAMES_PARAM)).andReturn("p1, p2, p3");

    WebXmlBasedContextLoader contextLoader = new WebXmlBasedContextLoader();

    replay(servletContext);

    ModuleDefinitionSource builder = contextLoader.getModuleDefinitionSource(servletContext, facade);
    RootModuleDefinition rootModuleDefinition = builder.getModuleDefinition();

    List<String> list = new ArrayList<String>();
    list.add("context1.xml");
    list.add("context2.xml");
View Full Code Here

Examples of org.impalaframework.web.spring.loader.WebXmlBasedContextLoader

    expect(servletContext.getInitParameter(WebXmlBasedContextLoader.CONFIG_LOCATION_PARAM)).andReturn(
        "context1.xml, context2.xml");
    expect(servletContext.getInitParameter(WebConstants.ROOT_MODULE_NAME_PARAM)).andReturn(
      null);

    WebXmlBasedContextLoader contextLoader = new WebXmlBasedContextLoader();

    replay(servletContext);

    try {
      contextLoader.getModuleDefinitionSource(servletContext, facade);
    }
    catch (ConfigurationException e) {
      assertEquals("Cannot create root module as the init-parameter 'rootModuleName' has not been specified", e.getMessage());
    }
   
View Full Code Here

Examples of org.impalaframework.web.spring.loader.WebXmlBasedContextLoader

    servletContext.setAttribute(eq(WebConstants.IMPALA_FACTORY_ATTRIBUTE), isA(ModuleManagementFacade.class));
    servletContext.setAttribute(eq(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE), isA(SingleStringModuleDefinitionSource.class));
   
    replay(servletContext);

    WebXmlBasedContextLoader loader = new WebXmlBasedContextLoader(){
      @Override
      public String[] getBootstrapContextLocations(ServletContext servletContext) {
        String[] locations = new String[] {
            "META-INF/impala-bootstrap.xml",
            "META-INF/impala-web-bootstrap.xml"};
        return locations;
      }
    };
    WebApplicationContext context = loader.createWebApplicationContext(servletContext, null);
   
    assertNotNull(context);
    assertTrue(context instanceof GenericWebApplicationContext);
    verify(servletContext);
 
View Full Code Here

Examples of org.impalaframework.web.spring.loader.WebXmlBasedContextLoader

    servletContext.setAttribute(eq(WebConstants.IMPALA_FACTORY_ATTRIBUTE), isA(ModuleManagementFacade.class));
    servletContext.setAttribute(eq(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE), isA(SingleStringModuleDefinitionSource.class));
   
    replay(servletContext);

    WebXmlBasedContextLoader loader = new WebXmlBasedContextLoader(){
      @Override
      public String[] getBootstrapContextLocations(ServletContext servletContext) {
        String[] locations = new String[] {
            "META-INF/impala-bootstrap.xml",
            "META-INF/impala-web-bootstrap.xml",
            "META-INF/impala-web-listener-bootstrap.xml"};
        return locations;
      }
    };
    WebApplicationContext context = loader.createWebApplicationContext(servletContext, null);
   
    assertNotNull(context);
    assertTrue(context instanceof GenericWebApplicationContext);
    verify(servletContext);
  }
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.