TransitionSet stickyTransitions = stickyCalculator.getTransitions(application, parentSpec1, parentSpec2);
doAssertions(stickyTransitions, 3);
}
public final void testAddParentLocations() {
RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2, plugin4");
RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2, plugin3");
//now show that the sticky calculator has the same set of changes, but omits the last one
ModificationExtractor stickyCalculator = new StickyModificationExtractor();
TransitionSet stickyTransitions = stickyCalculator.getTransitions(application, parentSpec1, parentSpec2);
Collection<? extends ModuleStateChange> moduleTransitions = stickyTransitions.getModuleTransitions();
assertEquals(1, moduleTransitions.size());
Iterator<? extends ModuleStateChange> iterator = moduleTransitions.iterator();
ModuleStateChange first = iterator.next();
assertEquals(Transition.UNLOADED_TO_LOADED, first.getTransition());
assertEquals("plugin3", first.getModuleDefinition().getName());
RootModuleDefinition newSpec = stickyTransitions.getNewRootModuleDefinition();
Collection<String> moduleNames = newSpec.getChildModuleNames();
assertEquals(4, moduleNames.size());
assertNotNull(newSpec.getChildModuleDefinition("plugin1"));
assertNotNull(newSpec.getChildModuleDefinition("plugin2"));
assertNotNull(newSpec.getChildModuleDefinition("plugin3"));
assertNotNull(newSpec.getChildModuleDefinition("plugin4"));
}