diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java (renamed from sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java) | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java index 6787804f06..f194751e6f 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java @@ -36,7 +36,7 @@ import org.oasisopen.sca.NoSuchServiceException; import sample.Helloworld; -public class NodeTestCase { +public class TuscanyRuntimeTestCase { @Test public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException { @@ -163,4 +163,27 @@ public class NodeTestCase { Assert.assertEquals(1, dcs.size()); Assert.assertEquals("helloworld.composite", dcs.get(0)); } + @Test + public void testRunComposite() throws NoSuchServiceException { + Node node = TuscanyRuntime.runComposite("helloworld.composite", "src/test/resources/sample-helloworld.jar"); + try { + Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent"); + Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); + } finally { + node.stop(); + } + } + + @Test + public void testRunCompositeSharedRuntime() throws NoSuchServiceException { + TuscanyRuntime runtime = TuscanyRuntime.newInstance(); + Node node = TuscanyRuntime.runComposite(runtime, "helloworld.composite", "src/test/resources/sample-helloworld.jar"); + try { + Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent"); + Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); + } finally { + node.stop(); + } + runtime.stop(); + } } |