Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.SimpleRootModuleDefinition


public class RootModuleTypeReader extends ApplicationModuleTypeReader {

  @Override
  protected ModuleDefinition newDefinition(ModuleDefinition parent,
      String moduleName, String[] locationsArray, String[] dependencyNames) {
    return new SimpleRootModuleDefinition(moduleName, locationsArray, dependencyNames, new ModuleDefinition[0]);
  }
View Full Code Here


    }
   
    public final void testNewApplicationContext() {
        final ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
        final GenericApplicationContext parent = new GenericApplicationContext();
        final GenericWebApplicationContext applicationContext = loader.newApplicationContext(null, parent, new SimpleRootModuleDefinition(projectNames, new String[]{"loc"}), classLoader);

        assertNotNull(applicationContext);
        assertNotNull(applicationContext.getBeanFactory());
        assertSame(classLoader, applicationContext.getClassLoader());
        assertSame(servletContext, applicationContext.getServletContext());
View Full Code Here

        assertSame(servletContext, applicationContext.getServletContext());
    }
   
    public void testGetSpringLocations() throws MalformedURLException {
        final String[] locations = new String[] {"context1", "context2"};
        SimpleModuleDefinition definition = new SimpleModuleDefinition(new SimpleRootModuleDefinition(projectNames, new String[]{"loc"}), "name", locations);
        loader.setServletContext(servletContext);
       
        expect(servletContext.getResource("/context1")).andReturn(new URL("file:file1"));
        expect(servletContext.getResource("/context1")).andReturn(new URL("file:file1"));
        expect(servletContext.getResource("/context2")).andReturn(new URL("file:file2"));
View Full Code Here

public class WebPlaceholderModuleDefinitionTest extends TestCase {
   
    private String projectName = "impala-core";
   
    public void testGetters() throws Exception {
        RootModuleDefinition parent = new SimpleRootModuleDefinition(projectName, "parent-context.xml");
        WebPlaceholderModuleDefinition definition1 = new WebPlaceholderModuleDefinition(parent, "placeholder");
        assertEquals("placeholder", definition1.getName());
        assertEquals(WebModuleTypes.WEB_PLACEHOLDER, definition1.getType());
        assertSame(parent, definition1.getParentDefinition());
        assertTrue(definition1.getConfigLocations().isEmpty());
View Full Code Here

        assertSame(parent, definition1.getParentDefinition());
        assertTrue(definition1.getConfigLocations().isEmpty());
    }  
   
    public void testEquals() throws Exception {
        RootModuleDefinition parent = new SimpleRootModuleDefinition(projectName, "parent-context.xml");
        WebPlaceholderModuleDefinition definition1 = new WebPlaceholderModuleDefinition(parent, "placeholder");
        WebPlaceholderModuleDefinition definition2 = new WebPlaceholderModuleDefinition(parent, "placeholder");
       
        assertEquals(definition1, definition2);
    }
View Full Code Here

       
        assertEquals(definition1, definition2);
    }
   
    public void testAdd() throws Exception {
        RootModuleDefinition parent = new SimpleRootModuleDefinition(projectName, "parent-context.xml");
        WebPlaceholderModuleDefinition definition1 = new WebPlaceholderModuleDefinition(parent, "placeholder");
        WebPlaceholderModuleDefinition definition3 = new WebPlaceholderModuleDefinition(parent, "toAdd");
       
        try {
            definition1.addChildModuleDefinition(definition3);
View Full Code Here

public class RootModuleTypeReader extends ApplicationModuleTypeReader {

    @Override
    protected ModuleDefinition newDefinition(ModuleDefinition parent,
            String moduleName, String type, String[] locationsArray, String[] dependencyNames, Map<String, String> attributes, String runtime) {
        return new SimpleRootModuleDefinition(moduleName, locationsArray, dependencyNames, attributes, new ModuleDefinition[0], null);
    }
View Full Code Here

  private RootModuleDefinition parent;

  public SimpleModuleDefinitionSource(String rootModuleName, String[] rootContextLocations, String[] moduleNames) {
    super();
    this.parent = new SimpleRootModuleDefinition(rootModuleName, rootContextLocations);
    setModuleNames(this.parent, moduleNames);
  }
View Full Code Here

    setModuleNames(this.parent, moduleNames);
  }

  public SimpleModuleDefinitionSource(String rootModuleName, String[] moduleNames) {
    super();   
    this.parent = new SimpleRootModuleDefinition(rootModuleName, new String[] { "applicationContext.xml" });
    setModuleNames(this.parent, moduleNames);
  }
View Full Code Here

    private RootModuleDefinition parent;

    public SimpleModuleDefinitionSource(String rootModuleName, String[] rootContextLocations, String[] moduleNames) {
        super();
        this.parent = new SimpleRootModuleDefinition(rootModuleName, rootContextLocations);
        setModuleNames(this.parent, moduleNames);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.definition.SimpleRootModuleDefinition

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.