WireFactoryService wireFactory = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), policyRegistry);
JavaContextFactoryBuilder javaBuilder = new JavaContextFactoryBuilder(wireFactory);
builderRegistry.register(javaBuilder);
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());
source.getGenericComponent().getString();
Assert.assertEquals(2, mockInterceptor.getCount());
child.publish(new ModuleStop(this));
runtime.stop();
}