185186187188189190191
moduleContext.locateService("TestServiceEP"); fail("Expected " + ServiceNotFoundException.class.getName()); } catch (ServiceNotFoundException e) { // expected } moduleContext.publish(new ModuleStop(this)); }
264265266267268269270
system.publish(new ModuleStart(this)); Component module1 = MockFactory.createCompositeComponent("module1"); runtime.registerModelObject(module1); runtime.getContext("module1"); Assert.assertTrue(((TestBuilder) system.getContext("TestBuilder").getInstance(null)).invoked()); system.publish(new ModuleStop(this)); }
113114115116117118119120121
ExternalService es = MockFactory.createESSystemBinding("TestService2ES", "tuscany.system/TestService2EP"); moduleContext.registerModelObject(es); moduleContext.publish(new ModuleStart(this)); Assert.assertNotNull(moduleContext.getContext("TestService2ES").getInstance(null)); moduleContext.publish(new ModuleStop(this)); system.publish(new ModuleStop(this)); runtime.stop(); }
818283848586878889
response = handler.invoke(null, hello, new Object[]{"foo"}); Assert.assertEquals("foo", response); Assert.assertEquals(3, mockInterceptor.getCount()); child.publish(new RequestEnd(this, id2)); child.publish(new ModuleStop(this)); runtime.stop(); }
5152535455565758
moduleContext.publish(new ModuleStart(this)); GenericSystemComponent component = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null); Assert.assertNotNull(component); GenericSystemComponent ep = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null); Assert.assertNotNull(ep); moduleContext.publish(new ModuleStop(this)); moduleContext.stop(); }
6566676869707172
8182838485868788
moduleContext.publish(new ModuleStart(this)); GenericSystemComponent test = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null); Assert.assertNotNull(test); GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null); Assert.assertNotNull(testEP); moduleContext.publish(new ModuleStop(this)); moduleContext.stop(); }
979899100101102103104
495051525354555657
scope.onEvent(new ModuleStart(this)); OrderedDependentPojo source = (OrderedDependentPojo) scope.getContext("source").getInstance(null); assertNotNull(source.getPojo()); // expire module assertEquals(2,source.getNumberInstantiated()); scope.onEvent(new ModuleStop(this)); assertEquals(0,source.getNumberInstantiated()); scope.stop(); }
139140141142143144145146
CompositeScopeContext scopeContainer = new CompositeScopeContext(ctx); scopeContainer.registerFactory(MockFactory.createCompositeConfiguration("CompositeComponent")); scopeContainer.start(); scopeContainer.onEvent(new ModuleStart(this)); scopeContainer.getContext("CompositeComponent"); scopeContainer.onEvent(new ModuleStop(this)); scopeContainer.stop(); }