RuntimeContext runtime = MockFactory.createCoreRuntime();
ModuleComponent child1 = createHierarchy();
runtime.getRootContext().registerModelObject(child1);
CompositeContext child1Ctx = (CompositeContext) runtime.getRootContext().getContext("child1");
Assert.assertNotNull(child1Ctx);
child1Ctx.publish(new ModuleStart(this));
analyzeLeafComponents(child1Ctx);
CompositeContext child2Ctx = (CompositeContext) child1Ctx.getContext("child2");
Assert.assertNotNull(child2Ctx);
child2Ctx.publish(new ModuleStart(this));
analyzeLeafComponents(child2Ctx);
CompositeContext child3Ctx = (CompositeContext) child2Ctx.getContext("child3");
Assert.assertNotNull(child3Ctx);
child3Ctx.publish(new ModuleStart(this));
analyzeLeafComponents(child3Ctx);
Assert.assertNull(child1Ctx.getContext("child3")); // sanity check
child1Ctx.publish(new ModuleStop(this));
}