From 37c624ca7d7bd356aca8e3aabd5103a1c8cf274f Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 4 Jun 2010 13:54:49 +0000 Subject: To keep it as simple as possible for now remove the multiple install methods git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@951411 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/something/Section10.java | 9 ++++----- .../tuscany/sca/something/impl/Section10Impl.java | 18 ------------------ .../tuscany/sca/something/Section10TestCase.java | 16 ++++++++-------- 3 files changed, 12 insertions(+), 31 deletions(-) (limited to 'sca-java-2.x/trunk/modules/domain/src') diff --git a/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/Section10.java b/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/Section10.java index 73a98816ff..e999a49943 100644 --- a/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/Section10.java +++ b/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/Section10.java @@ -64,15 +64,14 @@ public interface Section10 { * @throws ActivationException * @throws ValidationException */ - void installContribution(String uri, String contributionURL, List dependentContributionURIs) throws ContributionReadException, ActivationException, ValidationException; + void installContribution(String uri, String contributionURL, List dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException; + void installContribution(Contribution contribution, List dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException; - /* and i'd expect short forms of that for when you don't care or have the others:*/ + /* Useful short forms of that for when you don't care or have the others (but leave out for now to keep as simple as possible): String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException; void installContribution(String uri, String contributionURL) throws ContributionReadException, ActivationException, ValidationException; - /* autoDeploy indicates whether or not to automatically deploy the deployables defined in sca-contribution.xml */ String installContribution(String contributionURL, boolean autoDeploy) throws ContributionReadException, ActivationException, ValidationException; - void installContribution(String uri, String contributionURL, List dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException; - void installContribution(Contribution contribution, List dependentContributionURIs, boolean autoDeploy) throws ContributionReadException, ActivationException, ValidationException; + */ /** * 4577 10.5.1 install Contribution & update Contribution diff --git a/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java b/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java index 7a204c3278..c8486d3056 100644 --- a/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java +++ b/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java @@ -66,24 +66,6 @@ public class Section10Impl implements Section10 { this.extensionPointRegistry = extensionPointRegistry; } - public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException { - installContribution(contributionURL, contributionURL, null, true); - return contributionURL; - } - - public String installContribution(String contributionURL, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException { - installContribution(contributionURL, contributionURL, null, deployDeployables); - return contributionURL; - } - - public void installContribution(String uri, String contributionURL) throws ContributionReadException, ActivationException, ValidationException { - installContribution(uri, contributionURL, null, true); - } - - public void installContribution(String uri, String contributionURL, List dependentContributionURIs) throws ContributionReadException, ActivationException, ValidationException { - installContribution(uri, contributionURL, dependentContributionURIs, true); - } - public void installContribution(String uri, String contributionURL, List dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException { URL url = IOHelper.getLocationAsURL(contributionURL); Monitor monitor = deployer.createMonitor(); diff --git a/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java b/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java index fad4d87ced..efd0ec9143 100644 --- a/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java +++ b/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java @@ -36,7 +36,7 @@ public class Section10TestCase { @Test public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("src/test/resources/sample-helloworld.jar"); + section10.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, true); // Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent"); // Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); @@ -46,8 +46,8 @@ public class Section10TestCase { @Test public void testInstallWithDependent() throws NoSuchServiceException, ContributionReadException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store.jar"); - section10.installContribution("/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store-client.jar"); + section10.installContribution("store", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store.jar", null, true); + section10.installContribution("store-client", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store-client.jar", null, true); // Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent"); // Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); @@ -56,7 +56,7 @@ public class Section10TestCase { @Test public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - String contributionURI = section10.installContribution("src/test/resources/sample-helloworld-nodeployable.jar"); + section10.installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", null, true); // SCAClientFactory scaClientFactory = section10.getSCAClientFactory(); // try { @@ -66,7 +66,7 @@ public class Section10TestCase { // // expected as there is no deployables // } - section10.addToDomainLevelComposite(contributionURI + "/helloworld.composite"); + section10.addToDomainLevelComposite("helloworld" + "/helloworld.composite"); // Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent"); // Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); } @@ -74,7 +74,7 @@ public class Section10TestCase { @Test public void testGetInstalledContributions() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar"); + section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, true); List ics = section10.getInstalledContributions(); Assert.assertEquals(1, ics.size()); Assert.assertEquals("foo", ics.get(0)); @@ -83,7 +83,7 @@ public class Section10TestCase { @Test public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("foo", "src/test/resources/sample-helloworld.jar"); + section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, true); List dcs = section10.getDeployedCompostes("foo"); Assert.assertEquals(1, dcs.size()); Assert.assertEquals("foo/helloworld.composite", dcs.get(0)); @@ -92,7 +92,7 @@ public class Section10TestCase { @Test public void testRemoveComposte() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException { Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("foo", "src/test/resources/sample-helloworld.jar"); + section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, true); section10.removeFromDomainLevelComposite("foo/helloworld.composite"); List dcs = section10.getDeployedCompostes("foo"); Assert.assertEquals(0, dcs.size()); -- cgit v1.2.3