Package org.impalaframework.module.modification

Examples of org.impalaframework.module.modification.StrictModificationExtractor


        ApplicationManager applicationManager = TestApplicationManager.newApplicationManager(new ModuleClassLoaderRegistry(), moduleStateHolder, new DelegatingServiceRegistry());
        Application application = applicationManager.getCurrentApplication();
       
        RootModuleDefinition test1Definition = newTest1().getModuleDefinition();
        ModificationExtractor calculator = new StrictModificationExtractor();
        TransitionSet transitions = calculator.getTransitions(application, null, test1Definition);
       
        transitionManager.processTransitions(moduleStateHolder, application, transitions);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(moduleStateHolder);
        service((FileMonitor) context.getBean("bean1"));
        noService((FileMonitor) context.getBean("bean3"));

        RootModuleDefinition test2Definition = newTest2().getModuleDefinition();
        transitions = calculator.getTransitions(application, test1Definition, test2Definition);
        transitionManager.processTransitions(moduleStateHolder, application, transitions);

        context = SpringModuleUtils.getRootSpringContext(moduleStateHolder);
        service((FileMonitor) context.getBean("bean1"));
        //now we got bean3
View Full Code Here


     */
    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());
                return false;
            }
           
        });
        calculator.getTransitions(application, newRoot, parentSpec2);
    }  
View Full Code Here

        ModuleDefinition plugin2 = parentSpec2.findChildDefinition("plugin2", true);
        ModuleDefinition plugin4 = new SimpleModuleDefinition(plugin2, "plugin4");
        new SimpleModuleDefinition(plugin4, "plugin5");
        new SimpleModuleDefinition(plugin4, "plugin6");

        ModificationExtractor calculator = new StrictModificationExtractor();
        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
       
        Iterator<? extends ModuleStateChange> iterator = doAssertions(transitions, 4);
       
        ModuleStateChange change3 = iterator.next();
        assertEquals("plugin3", change3.getModuleDefinition().getName());
View Full Code Here

TOP

Related Classes of org.impalaframework.module.modification.StrictModificationExtractor

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.