From ed50ceeecd37525c923683c8e81c7edac2dba497 Mon Sep 17 00:00:00 2001 From: antelder Date: Fri, 21 May 2010 14:49:55 +0000 Subject: Update for Section10 interface updates and start to try to get it to work more as the spec describes so without nodes and to have installed contributions and deploying/undeploying composites. (The tests getService methods no longer work as the scaclient factory impl expects Nodes to have been created) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@947031 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/something/Section10TestCase.java | 56 ++++++++++------------ 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'sca-java-2.x/contrib/modules/section10/src/test/java/org') diff --git a/sca-java-2.x/contrib/modules/section10/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java b/sca-java-2.x/contrib/modules/section10/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java index 9838b065a6..76bc7c066d 100644 --- a/sca-java-2.x/contrib/modules/section10/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java +++ b/sca-java-2.x/contrib/modules/section10/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java @@ -18,44 +18,40 @@ */ package org.apache.tuscany.sca.something; -import junit.framework.Assert; +import java.net.MalformedURLException; +import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.junit.Test; import org.oasisopen.sca.NoSuchDomainException; import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -import sample.Helloworld; public class Section10TestCase { - @Test - public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException { - Section10 section10 = Section10Factory.createSection10(); - section10.installContribution("src/test/resources/sample-helloworld.jar"); - - SCAClientFactory scaClientFactory = section10.getSCAClientFactory(); - Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent"); - Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); - } +// @Test +// public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException { +// Section10 section10 = Section10Factory.createSection10(); +// section10.installContribution("src/test/resources/sample-helloworld.jar"); +// +//// Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent"); +//// Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); +// } +// +// @Test +// public void testInstallWithDependent() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException { +// 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"); +// +//// Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent"); +//// Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); +// } +// Doesnt work yet as addToDomainLevelComposite doesn't work @Test - public void testInstallWithDependent() throws NoSuchServiceException, NoSuchDomainException { + public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException { 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"); - - SCAClientFactory scaClientFactory = section10.getSCAClientFactory(); - Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent"); - Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); - } + String contributionURI = section10.installContribution("src/test/resources/sample-helloworld-nodeployable.jar"); -// Doesnt work yet as addToDomainLevelComposite doesn't work -// @Test -// public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException { -// Section10 section10 = Section10Factory.createSection10(); -// String contributionURI = section10.installContribution("src/test/resources/sample-helloworld-nodeployable.jar"); -// // SCAClientFactory scaClientFactory = section10.getSCAClientFactory(); // try { // scaClientFactory.getService(Helloworld.class, "HelloworldComponent"); @@ -63,10 +59,10 @@ public class Section10TestCase { // } catch (NoSuchServiceException e) { // // expected as there is no deployables // } -// -// section10.addToDomainLevelComposite(contributionURI + "/helloworld.composite"); + + section10.addToDomainLevelComposite(contributionURI + "/helloworld.composite"); // Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent"); // Assert.assertEquals("Hello petra", helloworldService.sayHello("petra")); -// } + } } -- cgit v1.2.3