Examples of TransitionSet


Examples of org.impalaframework.module.spi.TransitionSet

    public void testReloadChanged() {
        RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2, plugin3");
        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");
        parentSpec2.findChildDefinition("plugin1", true).setState(ModuleState.STALE);

        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
        assertEquals(parentSpec2, transitions.getNewRootModuleDefinition());

        Collection<? extends ModuleStateChange> moduleTransitions = transitions.getModuleTransitions();
        assertEquals(3, moduleTransitions.size());

        Iterator<? extends ModuleStateChange> iterator = moduleTransitions.iterator();
        ModuleStateChange change1 = iterator.next();
        ModuleStateChange change2 = iterator.next();
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

    public void testAddedChild() {
        RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");
        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin3, plugin2, plugin4");

        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
        assertEquals(parentSpec2, transitions.getNewRootModuleDefinition());

        Collection<? extends ModuleStateChange> pluginTransitions = transitions.getModuleTransitions();
        assertEquals(2, pluginTransitions.size());

        Iterator<? extends ModuleStateChange> iterator = pluginTransitions.iterator();

        ModuleStateChange change1 = iterator.next();
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");

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

        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
        assertEquals(parentSpec2, transitions.getNewRootModuleDefinition());

        Collection<? extends ModuleStateChange> pluginTransitions = transitions.getModuleTransitions();
        assertEquals(2, pluginTransitions.size());

        Iterator<? extends ModuleStateChange> iterator = pluginTransitions.iterator();

        ModuleStateChange change1 = iterator.next();
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

        definition.findChildDefinition("plugin3", true).setState(ModuleState.DEPENDENCY_FAILED);
        definition.findChildDefinition("plugin4", true).setState(ModuleState.DEPENDENCY_FAILED);
       
        Application application = TestApplicationManager.newApplicationManager().getCurrentApplication();
       
        TransitionSet transitions = new RepairModificationExtractor().getTransitions(application, definition, null);
        assertEquals(definition, transitions.getNewRootModuleDefinition());
       
        Collection<? extends ModuleStateChange> moduleTransitions = transitions.getModuleTransitions();
        assertEquals(3, moduleTransitions.size());
    }
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

    public void testGetTransitions() {
        GraphModificationExtractorDelegate delegate = new GraphModificationExtractorDelegate();
        SimpleRootModuleDefinition rootDefinitionOld = rootDefinition("orig");
        SimpleRootModuleDefinition rootDefinitionNew = rootDefinition("new");
        TransitionSet transitions = delegate.getTransitions(application, rootDefinitionOld, rootDefinitionNew);
        assertEquals(2, transitions.getModuleTransitions().size());
       
        assertNotNull(delegate.getNewDependencyManager());
        assertNotNull(delegate.getOldDependencyManager());
    }
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

        expect(moduleRuntimeManager.initModule(application, rootModuleDefinition)).andReturn(true);
       
        replayMocks();
       
        Set<ModuleStateChange> singleton = Collections.singleton(moduleStateChange);
        TransitionSet transitionSet = new TransitionSet(singleton, rootModuleDefinition);
        transitionManager.processTransitions(moduleStateHolder, application, transitionSet);
        verifyMocks();
    }
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

        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"));
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

        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

Examples of org.impalaframework.module.spi.TransitionSet

        expect(moduleDefinitionSource.getModuleDefinition()).andReturn(originalDefinition);
       
        SimpleRootModuleDefinition definition = new SimpleRootModuleDefinition("root", "config");
        definition.freeze();
       
        TransitionSet set = new TransitionSet(new ArrayList<ModuleStateChange>(), definition);
        expect(moduleStateHolder.cloneRootModuleDefinition()).andReturn(definition);
       
        expect(repairModificationExtractor.getTransitions(application, isA(RootModuleDefinition.class), isA(RootModuleDefinition.class))).andReturn(set);
   
        transitionManager.processTransitions(eq(moduleStateHolder), application, isA(TransitionSet.class));
View Full Code Here

Examples of org.impalaframework.module.spi.TransitionSet

    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
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.