Package org.impalaframework.module

Examples of org.impalaframework.module.RootModuleDefinition


    }
   
    public void testLoadFiveAndSix() {
        setExistingDefinition("impala-core");
        IncrementalModuleDefinitionSource moduleDefinitionSource = new IncrementalModuleDefinitionSource(resolver, typeReaderRegistry, rootModuleDefinition, "sample-module6");
        RootModuleDefinition root = moduleDefinitionSource.getModuleDefinition();
        assertTrue(root.hasSibling("sample-module5"));
       
        ModuleDefinition definition5 = root.findChildDefinition("sample-module5", true);
        assertNotNull(definition5);
        assertFalse(root.hasSibling("sample-module6"));
       
        ModuleDefinition definition6 = root.findChildDefinition("sample-module6", true);
        assertNotNull(definition6);
        assertNotNull(definition5.findChildDefinition("sample-module6", true));
        List<String> asList = definition6.getDependentModuleNames(false);
        assertEquals(Arrays.asList("sample-module5", "sample-module4"), asList);
       
View Full Code Here


   
    public void testLoadFive() {
        setExistingDefinition("impala-core");
        IncrementalModuleDefinitionSource moduleDefinitionSource = new IncrementalModuleDefinitionSource(resolver, typeReaderRegistry, rootModuleDefinition, "sample-module5");
       
        RootModuleDefinition root = moduleDefinitionSource.getModuleDefinition();
        assertTrue(root.hasSibling("sample-module5"));
       
        List<String> modulesToLoad = moduleDefinitionSource.getModulesToLoad();
        assertEquals(1, modulesToLoad.size());
        assertTrue(modulesToLoad.contains("sample-module5"));
    }
View Full Code Here

   
    public void testLoadSix() {
        setExistingDefinition("impala-core", "sample-module5");
        IncrementalModuleDefinitionSource moduleDefinitionSource = new IncrementalModuleDefinitionSource(resolver, typeReaderRegistry, rootModuleDefinition, "sample-module6");

        RootModuleDefinition root = moduleDefinitionSource.getModuleDefinition();
        assertTrue(root.hasSibling("sample-module5"));
       
        ModuleDefinition definition5 = root.findChildDefinition("sample-module5", true);
        assertNotNull(definition5);
        ModuleDefinition definition6 = definition5.findChildDefinition("sample-module6", true);
        assertNotNull(definition6);
       
        List<String> modulesToLoad = moduleDefinitionSource.getModulesToLoad();
View Full Code Here

        }
    }

    private void checkDefinition(
            IncrementalModuleDefinitionSource moduleDefinitionSource) {
        RootModuleDefinition newDefinition = moduleDefinitionSource.getModuleDefinition();
        System.out.println("New definition: " + newDefinition);
       
        ModuleDefinition module2 = newDefinition.findChildDefinition("sample-module2", true);
        assertNotNull(module2);
        ModuleDefinition module4 = newDefinition.findChildDefinition("sample-module4", true);
        assertNotNull(module4);
       
        assertTrue(newDefinition.getChildModuleDefinitions().contains(module2));
        assertEquals(1, newDefinition.getChildModuleDefinitions().size());
        assertTrue(module2.getChildModuleDefinitions().contains(module4));
        assertEquals(1, module2.getChildModuleDefinitions().size());
        assertTrue(module4.getChildModuleDefinitions().isEmpty());
    }
View Full Code Here

        assertNotNull(registry.getModuleLoader("spring-"+ModuleTypes.APPLICATION));

        ApplicationManager applicationManager = (ApplicationManager) context.getBean("applicationManager");
        Application application = applicationManager.getCurrentApplication();
       
        RootModuleDefinition definition = new Provider().getModuleDefinition();
        TransitionSet transitions = calculatorRegistry.getModificationExtractor(ModificationExtractorType.STRICT).getTransitions(application, null, definition);
        TransitionManager transitionManager = (TransitionManager) context.getBean("transitionManager");
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        transitionManager.processTransitions(moduleStateHolder, application, transitions);
View Full Code Here

        this.resolver = new StandaloneModuleLocationResolver();
        this.moduleDefinitionSource = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, moduleNames, true);
    }

    public void testGetModuleDefinition() {
        RootModuleDefinition moduleDefinition = moduleDefinitionSource.getModuleDefinition();
        System.out.println(moduleDefinition);
    }
View Full Code Here

        assertEquals("sample-module2", parents.get("sample-module4"));
    }
   
    public void testFindMissingDefinitionsSixOnly() throws Exception {
        InternalModuleDefinitionSource source = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, new String[]{"sample-module6"});
        final RootModuleDefinition rootDefinition = source.getModuleDefinition();
       
        System.out.println(rootDefinition);
        assertNotNull(rootDefinition.findChildDefinition("sample-module4", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module5", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module6", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module2", true));
        assertNotNull(rootDefinition.findChildDefinition("impala-core", true));
    }
View Full Code Here

    }
   
    public void testFindMissingDefinitionsFourOnly() throws Exception {
        InternalModuleDefinitionSource source = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, new String[]{"sample-module4"});
        System.out.println(source.getModuleDefinition());
        RootModuleDefinition rootDefinition = source.getModuleDefinition();
       
        assertEquals("impala-core", rootDefinition.getName());
        assertNotNull(rootDefinition.findChildDefinition("sample-module4", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module2", true));
        assertNotNull(rootDefinition.findChildDefinition("impala-core", true));
    }
View Full Code Here

        assertModulesPresent(source);
    }

    private void assertModulesPresent(InternalModuleDefinitionSource source) {
        RootModuleDefinition rootDefinition = source.getModuleDefinition();
        assertNotNull(rootDefinition.findChildDefinition("sample-module4", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module2", true));
        assertNotNull(rootDefinition.findChildDefinition("impala-core", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module5", true));
        assertNotNull(rootDefinition.findChildDefinition("sample-module6", true));
    }
View Full Code Here

   
    /**
     * This test demonstrates that after getting the transitions, the {@link RootModuleDefinition} is frozen
     */
    public final void testCheckFreezeUnfreeze() {
        RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2, plugin3");
        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");

        ModificationExtractor calculator = new StrictModificationExtractor();
        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
        RootModuleDefinition newRoot = transitions.getNewRootModuleDefinition();
       
        ModuleDefinitionWalker.walkRootDefinition(newRoot, new ModuleDefinitionCallback(){

            public boolean matches(ModuleDefinition moduleDefinition) {
                assertTrue(moduleDefinition.isFrozen());
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.