Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
}
@Test
public void testStopStart() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
Node node = TuscanyRuntime.newInstance().createNode("default");
node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
node.startComposite("helloworld", "helloworld.composite");
Map<String, List<String>> ci = node.getStartedCompositeURIs();
Assert.assertEquals(1, ci.size());
Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
node.stopComposite("helloworld", "helloworld.composite");
try {
node.getService(Helloworld.class, "HelloworldComponent");
Assert.fail();
} catch (NoSuchServiceException e) {
// expected as there is no deployables
}
node.startComposite("helloworld", "helloworld.composite");
helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
}