Impala.init();
System.out.println(getModuleDefinition());
Impala.init(this);
Application application = Impala.getCurrentApplication();
ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
BaseBeanGraphInheritanceStrategy strategy = new ParentFirstBeanGraphInheritanceStrategy();
assertTrue(strategy.getDelegateGetBeanCallsToParent());
checkExpected(moduleStateHolder, strategy, "sample-module4", 0);
checkExpected(moduleStateHolder, strategy, "sample-module6", 3);
checkExpected(moduleStateHolder, strategy, "sample-module5", 0);
checkExpected(moduleStateHolder, strategy, "sample-module2", 0);
checkExpected(moduleStateHolder, strategy, "impala-core", 0);
strategy = new GraphOrderedBeanInheritanceStrategy();
assertFalse(strategy.getDelegateGetBeanCallsToParent());
checkExpected(moduleStateHolder, strategy, "sample-module4", 2);
checkExpected(moduleStateHolder, strategy, "sample-module6", 4);
checkExpected(moduleStateHolder, strategy, "sample-module5", 0);
checkExpected(moduleStateHolder, strategy, "sample-module2", 1);
checkExpected(moduleStateHolder, strategy, "impala-core", 0);
executeBean("sample-module6", "bean4");
//check that the ordering can be swapped
ModuleDefinition definition = moduleStateHolder.getModuleDefinition().findChildDefinition("sample-module4", true);
final List<ModuleDefinition> dList = strategy.getDependencyList(definition, (GraphModuleStateHolder)moduleStateHolder);
assertTrue(dList.size() > 0);
final List<ModuleDefinition> dependencyList = new ArrayList<ModuleDefinition>(dList);
assertEquals(0, strategy.getRootModuleDefinitionIndex(dependencyList));