summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache')
-rw-r--r--sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java15
-rw-r--r--sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java2
-rw-r--r--sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java2
-rw-r--r--sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java14
-rw-r--r--sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java33
5 files changed, 45 insertions, 21 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
index 19370285f5..1ae4515e70 100644
--- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
+++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
@@ -19,17 +19,24 @@
package org.apache.tuscany.sca.binding.rss;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+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;
+
public class Consumer {
public static void main(String[] args) throws Exception {
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Consumer.composite");
+ String contribution = ContributionLocationHelper.getContributionLocation(Consumer.class);
+ Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/feed/Consumer.composite", new Contribution("consumer", contribution));
+
+ node.start();
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
+ CustomerClient testService = node.getService(CustomerClient.class, "CustomerClient");
testService.testCustomerCollection();
- scaDomain.close();
+ node.stop();
}
}
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
index e71156c379..a80f721136 100644
--- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
+++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
@@ -20,7 +20,7 @@
package org.apache.tuscany.sca.binding.rss;
import org.apache.tuscany.sca.binding.rss.collection.Collection;
-import org.osoa.sca.annotations.Reference;
+import org.oasisopen.sca.annotation.Reference;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
index 02d73ab3ae..4b5bf373e7 100644
--- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
+++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
@@ -29,7 +29,7 @@ import java.util.UUID;
import org.apache.tuscany.sca.binding.rss.collection.Collection;
import org.apache.tuscany.sca.binding.rss.collection.NotFoundException;
-import org.osoa.sca.annotations.Scope;
+import org.oasisopen.sca.annotation.Scope;
import com.sun.syndication.feed.synd.SyndContent;
import com.sun.syndication.feed.synd.SyndContentImpl;
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
index ae7b72834e..6dc23ac503 100644
--- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
+++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
@@ -21,13 +21,21 @@ package org.apache.tuscany.sca.binding.rss;
import java.io.IOException;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+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;
public class Provider {
public static void main(String[] args) {
+
+
+ String contribution = ContributionLocationHelper.getContributionLocation(Provider.class);
+ Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/feed/Provider.composite", new Contribution("provider", contribution));
+
+ node.start();
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/feed/Provider.composite");
System.out.println("Provider.composite ready...");
try {
@@ -36,6 +44,6 @@ public class Provider {
e.printStackTrace();
}
- scaDomain.close();
+ node.stop();
}
}
diff --git a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java
index cb5c280211..8eb007d75c 100644
--- a/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java
+++ b/sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java
@@ -21,7 +21,10 @@ package org.apache.tuscany.sca.binding.rss;
import junit.framework.Assert;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+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.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -30,33 +33,39 @@ import org.junit.Test;
* Basic test case that will get the feed entries from an RSS feed.
*/
public class RSSGetTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
+ protected static Node scaConsumerNode;
+ protected static Node scaProviderNode;
protected static CustomerClient testService;
@BeforeClass
public static void init() throws Exception {
System.out.println(">>>RSSGetTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/rss/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/rss/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
+ String contribution = ContributionLocationHelper.getContributionLocation(RSSGetTestCase.class);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/rss/Provider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
+ scaConsumerNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/rss/Consumer.composite", new Contribution("consumer", contribution));
+ scaConsumerNode.start();
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
}
@AfterClass
public static void destroy() throws Exception {
// System.out.println(">>>RSSGetTestCase.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
+ if (scaConsumerNode != null) {
+ scaConsumerNode.stop();
}
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
}
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
}