diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-19 10:19:55 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-19 10:19:55 +0000 |
commit | 15515ccfca972c119501c2d269ed83e586c515d6 (patch) | |
tree | 38f0f77e1f801c0c226b63c0330e0d652f8a03e7 /sca-java-2.x/trunk/modules/domain-node/src/test/java | |
parent | 58b2e5ffa7d3a0cd7c16e2cca9b305487bc03071 (diff) |
Fix runComposite with shared runtime instance and update testcase
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1060741 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test/java')
-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(); + } } |