summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-20 16:42:59 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-20 16:42:59 +0000
commit630599c9de5bce09c7fb1f1b657ae36164c5cc40 (patch)
treecac9a8b81dd1a10644128a0725183bc79b7d59fa /sca-java-2.x/trunk/itest
parent1006c4802c6dadbcc4ffc874044b8a8e7bf0ec2e (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')
-rw-r--r--sca-java-2.x/trunk/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java4
-rw-r--r--sca-java-2.x/trunk/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java12
-rw-r--r--sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java2
3 files changed, 11 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java b/sca-java-2.x/trunk/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
index 42bb229992..fbdc8c4a0b 100644
--- a/sca-java-2.x/trunk/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
+++ b/sca-java-2.x/trunk/itest/scaclient-api-jse-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;
@@ -49,7 +51,7 @@ public class SCAClientTestCase extends TestCase {
// 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
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");
assertEquals("Hello petra", service.sayHello("petra"));
}
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);
diff --git a/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java b/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
index e2bef08415..f4c3fd543d 100644
--- a/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
+++ b/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
@@ -38,7 +38,7 @@ public class SCAClientTestCase extends TestCase {
@Override
protected void setUp() throws Exception {
- node = NodeFactory.newInstance().createNode();
+ node = NodeFactory.getInstance().createNode();
node.start();
}