From e0d0f979b56b452bf01ea99e14f8037c633942ae Mon Sep 17 00:00:00 2001 From: antelder Date: Sun, 19 Jun 2011 07:44:31 +0000 Subject: Update contribution update to handle additional deployed composites and a testcase for that git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1137311 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/impl/ContributionUpdateTestCase.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test') diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/ContributionUpdateTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/ContributionUpdateTestCase.java index 105f9c71c8..f270eb3f23 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/ContributionUpdateTestCase.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/ContributionUpdateTestCase.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.impl; import java.io.FileNotFoundException; +import java.io.FileReader; import java.util.Collection; import javax.xml.stream.XMLStreamException; @@ -52,4 +53,23 @@ public class ContributionUpdateTestCase { Assert.assertEquals(1, eps.size()); Assert.assertEquals("Helloworld2Component#service-binding(Helloworld/Helloworld)", eps.iterator().next().getURI()); } + + @Test + public void updateWithAdditionalDeployablesTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException, FileNotFoundException { + Node node = TuscanyRuntime.newInstance().createNode("updateWithAdditionalDeployablesTest"); + String curi = node.installContribution("src/test/resources/sample-helloworld.jar"); + String compURI = node.addDeploymentComposite(curi, new FileReader("src/test/resources/helloworld2.composite")); + node.startComposite(curi, compURI); + + Collection eps = ((NodeImpl)node).getEndpointRegistry().getEndpoints(); + Assert.assertEquals(1, eps.size()); + Assert.assertEquals("Helloworld2Component#service-binding(Helloworld/Helloworld)", eps.iterator().next().getURI()); + + ((NodeImpl)node).updateContribution(curi, "src/test/resources/sample-helloworld.jar", null, null); + + eps = ((NodeImpl)node).getEndpointRegistry().getEndpoints(); + Assert.assertEquals(1, eps.size()); + Assert.assertEquals("Helloworld2Component#service-binding(Helloworld/Helloworld)", eps.iterator().next().getURI()); + } + } -- cgit v1.2.3