RuntimeContext runtime = new RuntimeContextImpl(monitorFactory, builderRegistry, defaultWireBuilder);
runtime.addBuilder(new JavaTargetWireBuilder());
runtime.start();
runtime.getRootContext().registerModelObject(
MockFactory.createCompositeComponent("test.module"));
CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
child.registerModelObject(MockFactory.createModule());
child.publish(new ModuleStart(this));
GenericComponent source = (GenericComponent) child.getContext("source").getInstance(null);
Assert.assertNotNull(source);
source.getGenericComponent().getString();
Assert.assertEquals(1, mockInterceptor.getCount());
Assert.assertEquals(1, mockHandler.getCount());
source.getGenericComponent().getString();
Assert.assertEquals(2, mockInterceptor.getCount());
Assert.assertEquals(2, mockHandler.getCount());
child.publish(new ModuleStop(this));
runtime.stop();
}