private RuntimeContext createScenario1Runtime() throws Exception {
RuntimeContext runtime = MockFactory.createCoreRuntime();
runtime.start();
SystemCompositeContext system = runtime.getSystemContext();
ModuleComponent system1Component = MockFactory.createSystemCompositeComponent("system1");
ModuleComponent system1aComponent = MockFactory.createSystemCompositeComponent("system1a");
system1Component.getImplementation().getComponents().add(system1aComponent);
Component target = MockFactory.createSystemComponent("target", Target.class, TargetImpl.class, Scope.MODULE);
system1Component.getImplementation().getComponents().add(target);
EntryPoint ep = MockFactory.createEPSystemBinding("target.ep", Target.class, "target", target);
system1Component.getImplementation().getEntryPoints().add(ep);
system.registerModelObject(system1Component);
EntryPoint systemEp = MockFactory.createEPSystemBinding("target.system.ep", Target.class, "ref");
systemEp.getBindings().add(systemFactory.createSystemBinding());
Service service = systemFactory.createService();
service.setName("system1/target.ep");
(systemEp.getConfiguredReference().getTargetConfiguredServices().get(0)).setPort(service);
system.registerModelObject(systemEp);
ModuleComponent app1Component = createAppModuleComponent("app1");
ModuleComponent app1aComponent = createAppModuleComponent("app1a");
Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
app1aComponent.getImplementation().getComponents().add(source);
app1Component.getImplementation().getComponents().add(app1aComponent);
CompositeContext root = runtime.getRootContext();
root.registerModelObject(app1Component);
system.publish(new ModuleStart(this));
return runtime;