diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-20 16:42:59 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-20 16:42:59 +0000 |
commit | 630599c9de5bce09c7fb1f1b657ae36164c5cc40 (patch) | |
tree | cac9a8b81dd1a10644128a0725183bc79b7d59fa /sca-java-2.x/trunk/itest/scaclient-api-osgi/src | |
parent | 1006c4802c6dadbcc4ffc874044b8a8e7bf0ec2e (diff) |
Start of making the Tuscany sca client impl work for both local or remote nodes and to be generic for any binding. Work in progress, only local invocations work presently
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@901270 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest/scaclient-api-osgi/src')
-rw-r--r-- | sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java b/sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java index c3cb8c20fa..2a2fcdf842 100644 --- a/sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java +++ b/sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java @@ -19,6 +19,8 @@ package test.scaclient; +import java.net.URI; + import itest.HelloworldService; import junit.framework.TestCase; @@ -26,6 +28,8 @@ import org.apache.tuscany.sca.node.Contribution; import org.apache.tuscany.sca.node.ContributionLocationHelper; import org.apache.tuscany.sca.node.Node; import org.apache.tuscany.sca.node.NodeFactory; +import org.oasisopen.sca.NoSuchDomainException; +import org.oasisopen.sca.NoSuchServiceException; import org.oasisopen.sca.client.SCAClientFactory; /** @@ -40,16 +44,14 @@ public class SCAClientTestCase extends TestCase { @Override protected void setUp() throws Exception { String location = ContributionLocationHelper.getContributionLocation(HelloworldService.class); - node = NodeFactory.newInstance().createNode("Helloworld.composite", new Contribution("test", "./target/classes")); + node = NodeFactory.getInstance().createNode("Helloworld.composite", new Contribution("test", "./target/classes")); System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); node.start(); } - public void testInvoke() throws Exception { - // At the moment the SCAClientFactory assumes that only one domain is active - // in a JVM. So we pass in null for the domain name and get what we're given + public void testInvoke() throws NoSuchServiceException, NoSuchDomainException { HelloworldService service = - SCAClientFactory.newInstance(null).getService(HelloworldService.class, "HelloworldComponent"); + SCAClientFactory.newInstance(URI.create("http://tuscany.apache.org/sca/1.1/domains/default")).getService(HelloworldService.class, "HelloworldComponent"); String result = service.sayHello("petra"); assertEquals("Hello petra", result); System.out.println("Result from SCAClient call = " + result); |