diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-24 21:41:17 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-24 21:41:17 +0000 |
commit | 4abe8b6a78e80783baa3b87aa87da49d1d338567 (patch) | |
tree | 24e280dff749c2006a0b2eaf3dc3523fd242ce72 /sca-java-2.x/trunk/modules/binding-rss-runtime/src/test/java/org | |
parent | fd6518e7e98dbb5964e39958c578b3013476af5d (diff) |
Porting Binding.RSS for 2.x runtime SPIs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@927191 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
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); } |