Package org.impalaframework.module

Examples of org.impalaframework.module.RootModuleDefinition


                ModuleOperationConstants.UpdateRootModuleOperation);
        operation.execute(input);
    }
   
    public void repairModules() {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.RepairModuleOperation);
        ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
                rootModuleDefinition);
View Full Code Here


    }

    /* **************************** getters ************************** */

    public boolean hasModule(String moduleName) {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        return (rootModuleDefinition.findChildDefinition(moduleName, true) != null);
    }
View Full Code Here

        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        return (rootModuleDefinition.findChildDefinition(moduleName, true) != null);
    }

    public String findLike(String moduleName) {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleDefinition definition = rootModuleDefinition.findChildDefinition(moduleName, false);
        if (definition != null) {
            return definition.getName();
        }
        return null;
    }
View Full Code Here

    }
   
    protected void postProcessBundleContext(BundleContext context) throws Exception {
       
        Impala.init();
        RootModuleDefinition definition = getModuleDefinition();
       
        ServiceReference serviceReference = context.getServiceReference(ModuleDefinitionSource.class.getName());
       
        Object service = context.getService(serviceReference);
       
View Full Code Here

       
    }
   
    public final void testGetParentOnlyDefinition() {
        builder.setResource(new ClassPathResource("xmlspec/parent-only-spec.xml"));
        RootModuleDefinition actual = builder.getModuleDefinition();
        assertEquals(0, actual.getChildModuleDefinitions().size());

        RootModuleDefinition expected = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parentTestContext.xml", "extra-context.xml" });
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    public final void testGetParentDefinition() {
        builder.setResource(new ClassPathResource("xmlspec/moduledefinition.xml"));
        RootModuleDefinition actual = builder.getModuleDefinition();
        assertEquals(3, actual.getChildModuleDefinitions().size());

        assertEquals(root, actual);
       
        assertEquals(definition1, actual.findChildDefinition(module1, true));
        assertEquals(definition2, actual.findChildDefinition(module2, true));
        assertEquals(definition3, actual.findChildDefinition(module3, true));
        assertEquals(definition4, actual.findChildDefinition(module4, true));
    }
View Full Code Here

        assertEquals(definition4, actual.findChildDefinition(module4, true));
    }
   
    public void testGetGraphDefinition() throws Exception {
        builder.setResource(new ClassPathResource("xmlspec/graphdefinition.xml"));
        RootModuleDefinition actual = builder.getModuleDefinition();
        assertEquals("project1", actual.getName());
        assertEquals(1, actual.getChildModuleDefinitions().size());
        assertEquals(1, actual.getSiblings().size());
       
        assertEquals(definition5, actual.findChildDefinition(module5, true));
        assertEquals(definition6, actual.findChildDefinition(module6, true));
        assertEquals(definition5, actual.findChildDefinition(module6, true).getParentDefinition());
       
        assertEquals(Arrays.asList("sample-module3,sample-module4,sample-module5".split(",")), definition6.getDependentModuleNames(false));

    }
View Full Code Here

    public void testGetModuleDefinition() {
       
        assertTrue(orphans.contains("sample-module5"));
       
        InternalPropertiesModuleDefinitionSource builder = new InternalPropertiesModuleDefinitionSource(typeReaderRegistry, rootModuleName, moduleProperties, children, orphans);
        RootModuleDefinition definition = builder.getModuleDefinition();
        System.out.println(definition);
       
        RootModuleDefinition root = new SimpleRootModuleDefinition("impala-core", "parentTestContext.xml");
        SimpleModuleDefinition sample2 = new SimpleModuleDefinition(root, "sample-module2");
        new SimpleModuleDefinition(sample2, "sample-module4");
       
        assertEquals(root, definition);
    }
View Full Code Here

    assertEquals("name2", uncommentedNames.get(1));
  }
   
    public void testGetModuleDefinitionGraph() {
        moduleDefinitionSource.setResource(new ClassPathResource("xmlinternal/modulegraph.xml"));
        RootModuleDefinition moduleDefinition = moduleDefinitionSource.getModuleDefinition();
        System.out.println(moduleDefinition);
       
        ModuleDefinition definition1 = getDefinition(moduleDefinition, "sample-module1");
        assertEquals(ModuleTypes.APPLICATION, definition1.getType());
        assertEquals(Arrays.asList(new String[0]), definition1.getConfigLocations());
       
        ModuleDefinition definition2 = getDefinition(moduleDefinition, "sample-module2");
        getDefinition(definition2, "sample-module3");
        getDefinition(definition2, "sample-module4");
       
        ModuleDefinition definition5 = moduleDefinition.getSiblingModule("sample-module5");
        assertNotNull(definition5);
       
        ModuleDefinition definition = getDefinition(definition5, "sample-module6");
        assertEquals(Arrays.asList("sample-module3,sample-module4,sample-module5".split(",")), definition.getDependentModuleNames(false));
    }
View Full Code Here

        assertEquals(Arrays.asList("sample-module3,sample-module4,sample-module5".split(",")), definition.getDependentModuleNames(false));
    }
   
    public void testGetModuleDefinition() {
        moduleDefinitionSource.setResource(new ClassPathResource("xmlinternal/moduledefinition.xml"));
        RootModuleDefinition moduleDefinition = moduleDefinitionSource.getModuleDefinition();
        System.out.println(moduleDefinition);
       
        assertEquals(Arrays.asList(new String[]{"parentTestContext.xml"}), moduleDefinition.getConfigLocations());
        assertEquals(2, moduleDefinition.getChildModuleDefinitions().size());
       
        ModuleDefinition definition1 = getDefinition(moduleDefinition, "sample-module1");
        assertEquals(ModuleTypes.APPLICATION, definition1.getType());
        assertEquals(Arrays.asList(new String[0]), definition1.getConfigLocations());
       
View Full Code Here

TOP

Related Classes of org.impalaframework.module.RootModuleDefinition

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.