CompositeContext moduleContext = createContext();
Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
moduleContext.start();
moduleContext.registerModelObject(component);
moduleContext.publish(new ModuleStart(this));
GenericSystemComponent test = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
Assert.assertNotNull(test);
EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
moduleContext.registerModelObject(ep);
GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
Assert.assertNotNull(testEP);
moduleContext.publish(new ModuleStop(this));
moduleContext.stop();
}