diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-17 15:22:53 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-17 15:22:53 +0000 |
commit | ccb49a7f5e15c1b47c91ae69f9509289bec87546 (patch) | |
tree | f6c981268bca160d5aa601755f13239a9621eeaa /sca-java-2.x/trunk/modules/domain-node | |
parent | b9c6321ba32b7df4eb4046e3ad512a4a6a37909b (diff) |
Add a testcase for stopCompositeAndUninstallUnused
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1136909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java index 1d1e70b11e..45dbec605a 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/Node2TestCase.java @@ -286,4 +286,27 @@ public class Node2TestCase { // node.stopComposite("sample-helloworld", "helloworld.composite");
}
+ @Test
+ public void stopAndUnistallTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
+ Node node = TuscanyRuntime.newInstance().createNode("stopAndUnistallTest");
+ node.installContribution("src/test/resources/import.jar");
+ node.installContribution("src/test/resources/export.jar");
+ String compositeXML =
+ "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
+ + " xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
+ + " targetNamespace=\"http://test/composite\""
+ + " name=\"TestComposite\">"
+ + " <component name=\"TestComponent\">"
+ + " <implementation.java class=\"sample.HelloworldImpl\"/>"
+ + " </component>"
+ + "</composite>";
+ String compositeURI = node.addDeploymentComposite("export", new StringReader(compositeXML));
+ node.startComposite("import", "helloworld.composite");
+ node.startComposite("export", compositeURI);
+ Assert.assertEquals(2, node.getInstalledContributionURIs().size());
+ node.stopCompositeAndUninstallUnused("import", "helloworld.composite");
+ Assert.assertEquals(1, node.getInstalledContributionURIs().size());
+ node.stopCompositeAndUninstallUnused("export", compositeURI);
+ Assert.assertEquals(0, node.getInstalledContributionURIs().size());
+ }
}
|