summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-atom-runtime
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-08 05:53:12 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-08 05:53:12 +0000
commitae8f4bb1767a39aef4eeed60edfc93dd2125979f (patch)
tree6a6af7f07d8659614299bd0949c515e6b019239f /java/sca/modules/binding-atom-runtime
parent878de5aa92458565d84c737333ea404f21c67033 (diff)
Bringing up Atom Binding test cases
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@823041 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-atom-runtime')
-rw-r--r--java/sca/modules/binding-atom-runtime/pom.xml7
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AbstractProviderConsumerTestCase.java51
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java37
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java31
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java35
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java34
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java33
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java13
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java30
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java36
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java2
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java2
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerNonCollectionImpl.java2
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java2
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java32
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java11
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java36
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java34
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java28
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Aggregator.java8
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorImpl.java12
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java33
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Sort.java3
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/SortImpl.java4
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/util/AtomTestCaseUtils.java (renamed from java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java)2
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite4
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite4
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite4
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite4
-rw-r--r--java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite4
30 files changed, 342 insertions, 196 deletions
diff --git a/java/sca/modules/binding-atom-runtime/pom.xml b/java/sca/modules/binding-atom-runtime/pom.xml
index 16013cc01a..8c31e4e9ac 100644
--- a/java/sca/modules/binding-atom-runtime/pom.xml
+++ b/java/sca/modules/binding-atom-runtime/pom.xml
@@ -183,6 +183,13 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-jetty</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AbstractProviderConsumerTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AbstractProviderConsumerTestCase.java
new file mode 100644
index 0000000000..d60cc5bed2
--- /dev/null
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AbstractProviderConsumerTestCase.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.atom;
+
+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 abstract class AbstractProviderConsumerTestCase {
+ protected static Node scaProviderNode;
+ protected static Node scaConsumerNode;
+
+ protected static void initTestEnvironment(Class<?> testClazz) throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(testClazz);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
+ scaConsumerNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Consumer.composite", new Contribution("consumer", contribution));
+ scaConsumerNode.start();
+ }
+
+ protected static void destroyTestEnvironment() throws Exception {
+ if (scaConsumerNode != null) {
+ scaConsumerNode.stop();
+ scaConsumerNode.destroy();
+ }
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
+ scaProviderNode.destroy();
+ }
+ }
+}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
index a427a076cd..eedc82624a 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomDeleteTestCase.java
@@ -26,41 +26,44 @@ import org.apache.abdera.Abdera;
import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Node;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-public class AtomDeleteTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
+public class AtomDeleteTestCase extends AbstractProviderConsumerTestCase {
+ private static Node scaProviderNode;
+ private static Node scaConsumerNode;
+
protected static CustomerClient testService;
protected static Abdera abdera;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomDeleteTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>AtomDeleteTestCase.init entry");
+
+ initTestEnvironment(AtomDeleteTestCase.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+ abdera = new Abdera();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
// System.out.println(">>>AtomDeleteTestCase.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
- }
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
Assert.assertNotNull(abdera);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java
index 4f91ff492a..3605ff50b8 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomFeedNonCollectionTest.java
@@ -29,7 +29,6 @@ import org.apache.abdera.model.Link;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
import org.apache.tuscany.sca.data.collection.Entry;
import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -40,7 +39,7 @@ import org.junit.Test;
* Test cases for using an Atom feed that does not implement
* the Collections interface but does have a getAll() method.
*/
-public class AtomFeedNonCollectionTest {
+public class AtomFeedNonCollectionTest extends AbstractProviderConsumerTestCase {
/**
* Used to generate unique IDs for the feed entries.
*/
@@ -66,36 +65,34 @@ public class AtomFeedNonCollectionTest {
*/
private static final int FEED_ENTRY_COUNT = FEED_ENTRY_TITLES.length;
- private static SCADomain scaConsumerDomain;
- private static SCADomain scaProviderDomain;
private static CustomerClient testService;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomFeedNonCollectionTest.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
+ try {
+ //System.out.println(">>>AtomFeedNonCollectionTest.init entry");
+
+ initTestEnvironment(AtomFeedNonCollectionTest.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
- System.out.println(">>>AtomFeedNonCollectionTest.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
- }
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+ destroyTestEnvironment();
}
/**
* Make sure everything has been initialised correctly.
*/
+ @SuppressWarnings("unchecked")
@Before
public void testPrelim() {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaConsumerNode);
+ Assert.assertNotNull(scaProviderNode);
Assert.assertNotNull(testService);
// Add some entries to the Atom feed
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
index 32a01ebe2a..0feb544eb7 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomGetTestCase.java
@@ -24,41 +24,42 @@ import org.apache.abdera.Abdera;
import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Node;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-public class AtomGetTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
+public class AtomGetTestCase extends AbstractProviderConsumerTestCase {
+ private static Node scaProviderNode;
+ private static Node scaConsumerNode;
+
protected static CustomerClient testService;
protected static Abdera abdera;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomGetTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>AtomGetTestCase.init entry");
+
+ initTestEnvironment(AtomFeedNonCollectionTest.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+ abdera = new Abdera();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
// System.out.println(">>>AtomGetTestCase.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
- }
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
Assert.assertNotNull(abdera);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
index 49e9c2f25f..ddc8802eb3 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPostTestCase.java
@@ -24,41 +24,39 @@ import org.apache.abdera.Abdera;
import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-public class AtomPostTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
+public class AtomPostTestCase extends AbstractProviderConsumerTestCase {
protected static CustomerClient testService;
protected static Abdera abdera;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomPostTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>AtomPostTestCase.init entry");
+
+ initTestEnvironment(AtomPostTestCase.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+ abdera = new Abdera();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
- System.out.println(">>>AtomPostTestCase.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
- }
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+ //System.out.println(">>>AtomPostTestCase.destroy entry");
+
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
Assert.assertNotNull(abdera);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
index 3aaad681f4..ed9d8db110 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomPutTestCase.java
@@ -26,41 +26,40 @@ import org.apache.abdera.Abdera;
import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-public class AtomPutTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
+public class AtomPutTestCase extends AbstractProviderConsumerTestCase {
+
protected static CustomerClient testService;
protected static Abdera abdera;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomPutTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>AtomPutTestCase.init entry");
+
+ initTestEnvironment(AtomPutTestCase.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+ abdera = new Abdera();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
// System.out.println(">>>AtomPutTestCase.destroy entry");
- if (scaConsumerDomain != null) {
- scaConsumerDomain.close();
- }
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
Assert.assertNotNull(abdera);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java
index 34d3ed1d1c..fd5b3a16e1 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Consumer.java
@@ -19,17 +19,22 @@
package org.apache.tuscany.sca.binding.atom;
-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/atom/Consumer.composite");
+ String contribution = ContributionLocationHelper.getContributionLocation(Consumer.class);
+ Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Consumer.composite",new Contribution("c1", contribution));
- CustomerClient testService = scaDomain.getService(CustomerClient.class, "CustomerClient");
+ CustomerClient testService = node.getService(CustomerClient.class, "CustomerClient");
testService.testCustomerCollection();
- scaDomain.close();
+ node.stop();
+ node.destroy();
}
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
index 9af85a970c..f28f0f0bed 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ConsumerProviderAtomTestCase.java
@@ -27,7 +27,6 @@ import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.abdera.model.Feed;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -35,33 +34,36 @@ import org.junit.Test;
/**
* Test case for the given package.
*/
-public class ConsumerProviderAtomTestCase {
+public class ConsumerProviderAtomTestCase extends AbstractProviderConsumerTestCase {
- protected static SCADomain scaConsumerDomain;
- protected static SCADomain scaProviderDomain;
protected static CustomerClient testService;
protected static Abdera abdera;
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>AtomBindingIntegratedTestCase.init entry");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class,"CustomerClient");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>AtomBindingIntegratedTestCase.init entry");
+
+ initTestEnvironment(ConsumerProviderAtomTestCase.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class,"CustomerClient");
+ abdera = new Abdera();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
- System.out.println(">>>AtomBindingIntegratedTestCase.destroy entry");
- scaConsumerDomain.close();
- scaProviderDomain.close();
+ //System.out.println(">>>AtomBindingIntegratedTestCase.destroy entry");
+
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
- Assert.assertNotNull(scaConsumerDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull(testService);
Assert.assertNotNull(abdera);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
index 72101f1531..0cc1b94825 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ContentNegotiationTest.java
@@ -36,7 +36,10 @@ import org.apache.abdera.protocol.Response.ResponseType;
import org.apache.abdera.protocol.client.AbderaClient;
import org.apache.abdera.protocol.client.ClientResponse;
import org.apache.abdera.protocol.client.RequestOptions;
-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;
@@ -48,9 +51,11 @@ import org.junit.Test;
* Uses the Abdera provided Client to act as a client.
*/
public class ContentNegotiationTest {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
+ public final static String providerURI = "http://localhost:8084/customer";
+
+ protected static Node scaProviderNode;
+
+ protected static CustomerClient testService;
protected static Abdera abdera;
protected static AbderaClient client;
protected static Parser abderaParser;
@@ -58,22 +63,33 @@ public class ContentNegotiationTest {
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>ContentNegotiationTest.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
+ try {
+ //System.out.println(">>>ContentNegotiationTest.init");
+ String contribution = ContributionLocationHelper.getContributionLocation(ContentNegotiationTest.class);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
+ abdera = new Abdera();
client = new AbderaClient(abdera);
abderaParser = Abdera.getNewParser();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
- System.out.println(">>>ContentNegotiationTest.destroy");
- scaProviderDomain.close();
+ //System.out.println(">>>ContentNegotiationTest.destroy");
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
+ scaProviderNode.destroy();
+ }
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
+ Assert.assertNotNull(scaProviderNode);
Assert.assertNotNull( client );
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
index 3e5705b14c..0aefce608b 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerClientImpl.java
@@ -24,7 +24,7 @@ import org.apache.abdera.model.Content;
import org.apache.abdera.model.Entry;
import org.apache.abdera.model.Feed;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.osoa.sca.annotations.Reference;
+import org.oasisopen.sca.annotation.Reference;
public class CustomerClientImpl implements CustomerClient {
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
index db66b00a50..222dc3e394 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerCollectionImpl.java
@@ -30,7 +30,7 @@ import org.apache.abdera.model.Entry;
import org.apache.abdera.model.Feed;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
-import org.osoa.sca.annotations.Scope;
+import org.oasisopen.sca.annotation.Scope;
@Scope("COMPOSITE")
public class CustomerCollectionImpl implements Collection {
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerNonCollectionImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerNonCollectionImpl.java
index a25e19838f..643596147b 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerNonCollectionImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/CustomerNonCollectionImpl.java
@@ -20,7 +20,7 @@
package org.apache.tuscany.sca.binding.atom;
import org.apache.tuscany.sca.data.collection.Entry;
-import org.osoa.sca.annotations.Scope;
+import org.oasisopen.sca.annotation.Scope;
/**
* Implementation of an Atom feed that does not implement the Collections
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java
index 385510b93f..d1d6135108 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionImpl.java
@@ -34,7 +34,7 @@ import org.apache.abdera.model.Entry;
import org.apache.abdera.model.Feed;
import org.apache.tuscany.sca.binding.atom.collection.MediaCollection;
import org.apache.tuscany.sca.binding.atom.collection.NotFoundException;
-import org.osoa.sca.annotations.Scope;
+import org.oasisopen.sca.annotation.Scope;
@Scope("COMPOSITE")
public class MediaCollectionImpl implements MediaCollection {
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java
index 2ed0729b00..a7f6ab6291 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java
@@ -37,7 +37,10 @@ import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
-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;
@@ -50,9 +53,11 @@ import org.junit.Test;
* Uses the Abdera provided Client to act as a client.
*/
public class MediaCollectionTestCase {
- public final static String providerURI = "http://localhost:8084/receipt";
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
+ public final static String providerURI = "http://localhost:8084/receipt";
+
+ protected static Node scaProviderNode;
+
+ protected static CustomerClient testService;
protected static Abdera abdera;
protected static AbderaClient client;
protected static Parser abderaParser;
@@ -63,24 +68,33 @@ public class MediaCollectionTestCase {
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>MediaCollectionTestCase.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite");
+ try {
+ //System.out.println(">>>MediaCollectionTestCase.init");
+ String contribution = ContributionLocationHelper.getContributionLocation(MediaCollectionTestCase.class);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
abdera = new Abdera();
client = new AbderaClient(abdera);
abderaParser = Abdera.getNewParser();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
System.out.println(">>>MediaCollectionTestCase.destroy");
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
+ scaProviderNode.destroy();
}
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
+ Assert.assertNotNull(scaProviderNode);
Assert.assertNotNull( client );
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java
index 3e1bf543e5..d116b97adc 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/Provider.java
@@ -21,13 +21,17 @@ package org.apache.tuscany.sca.binding.atom;
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) {
- SCADomain scaDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
+ String contribution = ContributionLocationHelper.getContributionLocation(Provider.class);
+ Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("c1", contribution));
System.out.println("Provider.composite ready...");
try {
@@ -36,6 +40,7 @@ public class Provider {
e.printStackTrace();
}
- scaDomain.close();
+ node.stop();
+ node.destroy();
}
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java
index c209e2dfe6..9ffd98c283 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderEntryEntityTagsTestCase.java
@@ -33,7 +33,10 @@ import org.apache.abdera.protocol.client.AbderaClient;
import org.apache.abdera.protocol.client.ClientResponse;
import org.apache.abdera.protocol.client.RequestOptions;
import org.apache.abdera.protocol.client.util.BaseRequestEntity;
-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;
@@ -46,9 +49,11 @@ import org.junit.Test;
* Uses the Abdera provided Client to act as a client.
*/
public class ProviderEntryEntityTagsTestCase {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
+ public final static String providerURI = "http://localhost:8084/customer";
+
+ protected static Node scaProviderNode;
+
+ protected static CustomerClient testService;
protected static Abdera abdera;
protected static AbderaClient client;
protected static Parser abderaParser;
@@ -58,24 +63,29 @@ public class ProviderEntryEntityTagsTestCase {
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>ProviderEntryEntityTagsTestCase.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
+ //System.out.println(">>>ProviderEntryEntityTagsTestCase.init");
+ String contribution = ContributionLocationHelper.getContributionLocation(ProviderEntryEntityTagsTestCase.class);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
+ abdera = new Abdera();
+ client = new AbderaClient(abdera);
+ abderaParser = Abdera.getNewParser();
}
@AfterClass
public static void destroy() throws Exception {
- System.out.println(">>>ProviderEntryEntityTagsTestCase.destroy");
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
+ //System.out.println(">>>ProviderEntryEntityTagsTestCase.destroy");
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
+ scaProviderNode.destroy();
}
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
+ Assert.assertNotNull(scaProviderNode);
Assert.assertNotNull( client );
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
index 42edeb8f0d..59fce99751 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
@@ -39,7 +39,10 @@ import org.apache.abdera.protocol.Response.ResponseType;
import org.apache.abdera.protocol.client.AbderaClient;
import org.apache.abdera.protocol.client.ClientResponse;
import org.apache.abdera.protocol.client.RequestOptions;
-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;
@@ -52,9 +55,11 @@ import org.junit.Test;
* Uses the Abdera provided Client to act as a client.
*/
public class ProviderFeedEntityTagsTestCase {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static CustomerClient testService;
+ public final static String providerURI = "http://localhost:8084/customer";
+
+ protected static Node scaProviderNode;
+
+ protected static CustomerClient testService;
protected static Abdera abdera;
protected static AbderaClient client;
protected static Parser abderaParser;
@@ -64,24 +69,29 @@ public class ProviderFeedEntityTagsTestCase {
@BeforeClass
public static void init() throws Exception {
- System.out.println(">>>ProviderFeedEntityTagsTestCase.init");
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
+ //System.out.println(">>>ProviderFeedEntityTagsTestCase.init");
+ String contribution = ContributionLocationHelper.getContributionLocation(ProviderEntryEntityTagsTestCase.class);
+
+ scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("provider", contribution));
+ scaProviderNode.start();
+
+ abdera = new Abdera();
+ client = new AbderaClient(abdera);
+ abderaParser = Abdera.getNewParser();
}
@AfterClass
public static void destroy() throws Exception {
System.out.println(">>>ProviderFeedEntityTagsTestCase.destroy");
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
+ if (scaProviderNode != null) {
+ scaProviderNode.stop();
+ scaProviderNode.destroy();
}
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
+ Assert.assertNotNull(scaProviderNode);
Assert.assertNotNull( client );
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java
index 0d4194070d..89bd8ade4e 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderServiceDocumentTestCase.java
@@ -36,7 +36,6 @@ import org.apache.abdera.protocol.Response.ResponseType;
import org.apache.abdera.protocol.client.AbderaClient;
import org.apache.abdera.protocol.client.ClientResponse;
import org.apache.tuscany.sca.binding.atom.collection.Collection;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -46,10 +45,9 @@ import org.junit.Test;
* Uses the SCA provided Provider composite to act as a server.
* Uses the Abdera provided Client to act as a client.
*/
-public class ProviderServiceDocumentTestCase {
- public final static String providerURI = "http://localhost:8084/customer";
- protected static SCADomain scaProviderDomain;
- protected static SCADomain scaConsumerDomain;
+public class ProviderServiceDocumentTestCase extends AbstractProviderConsumerTestCase {
+ public final static String providerURI = "http://localhost:8084/customer";
+
protected static CustomerClient testService;
protected static Abdera abdera;
protected static AbderaClient client;
@@ -57,24 +55,24 @@ public class ProviderServiceDocumentTestCase {
@BeforeClass
public static void init() throws Exception {
- scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
- scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
- testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
- abdera = new Abdera();
- client = new AbderaClient(abdera);
- abderaParser = Abdera.getNewParser();
+ initTestEnvironment(AtomPostTestCase.class);
+
+ testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
+
+ abdera = new Abdera();
+ client = new AbderaClient(abdera);
+ abderaParser = Abdera.getNewParser();
}
@AfterClass
public static void destroy() throws Exception {
- if (scaProviderDomain != null) {
- scaProviderDomain.close();
- }
+ destroyTestEnvironment();
}
@Test
public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderDomain);
+ Assert.assertNotNull(scaProviderNode);
+ Assert.assertNotNull(scaConsumerNode);
Assert.assertNotNull( client );
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Aggregator.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Aggregator.java
index 213ae53527..e10d442953 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Aggregator.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Aggregator.java
@@ -21,8 +21,14 @@ package org.apache.tuscany.sca.binding.atom.aggregator;
import org.apache.tuscany.sca.data.collection.Collection;
import org.apache.tuscany.sca.data.collection.Item;
-import org.osoa.sca.annotations.Remotable;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Aggreator interface
+ *
+ * @version $Rev$ $Date$
+ */
@Remotable
public interface Aggregator extends Collection<String, Item>{
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorImpl.java
index 4037babd13..7bd4892372 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorImpl.java
@@ -26,9 +26,15 @@ import org.apache.tuscany.sca.data.collection.Collection;
import org.apache.tuscany.sca.data.collection.Entry;
import org.apache.tuscany.sca.data.collection.Item;
import org.apache.tuscany.sca.data.collection.NotFoundException;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * Aggregator impl
+ *
+ * @version $Rev$ $Date$
+ */
public class AggregatorImpl implements Aggregator {
@Reference(required = false)
@@ -67,6 +73,7 @@ public class AggregatorImpl implements Aggregator {
}
+ @SuppressWarnings("unchecked")
public Entry<String, Item>[] getAll() {
// Aggregate entries from atomFeed1, atomFeed2, rssFeed1 and rssFeed2
@@ -105,6 +112,7 @@ public class AggregatorImpl implements Aggregator {
public void put(String id, Item entry) {
}
+ @SuppressWarnings("unchecked")
public Entry<String, Item>[] query(String queryString) {
ArrayList<Entry> entries = new ArrayList<Entry>();
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java
index 9cd94b2bd7..b2981d30de 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/AggregatorTestCase.java
@@ -23,29 +23,44 @@ import java.net.Socket;
import org.apache.tuscany.sca.data.collection.Entry;
import org.apache.tuscany.sca.data.collection.Item;
-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.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-
+/**
+ * Agregattor test case
+ *
+ * @version $Rev$ $Date$
+ */
public class AggregatorTestCase {
- private static SCADomain domain;
+ private static Node node;
+
private static Aggregator aggregatorService;
@BeforeClass
public static void init() throws Exception {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite");
- Assert.assertNotNull(domain);
- aggregatorService = domain.getService(Aggregator.class, "AtomAggregator");
- Assert.assertNotNull(aggregatorService);
+ try {
+ String contribution = ContributionLocationHelper.getContributionLocation(AggregatorTestCase.class);
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite", new Contribution("test", contribution));
+ node.start();
+
+ aggregatorService = node.getService(Aggregator.class, "AtomAggregator");
+ Assert.assertNotNull(aggregatorService);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@AfterClass
public static void destroy() throws Exception {
- if(domain != null) {
- domain.close();
+ if(node != null) {
+ node.stop();
+ node.destroy();
}
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Sort.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Sort.java
index 8b22dd3efa..28ea465968 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Sort.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/Sort.java
@@ -25,7 +25,7 @@ import org.apache.tuscany.sca.data.collection.Entry;
/**
* The Sort service business interface.
*
- * @version $Rev: 639931 $ $Date: 2008-03-21 18:13:05 -0700 (Fri, 21 Mar 2008) $
+ * @version $Rev$ $Date$
*/
public interface Sort {
@@ -34,5 +34,6 @@ public interface Sort {
* @param entries
* @return
*/
+ @SuppressWarnings("unchecked")
List<Entry> sort(List<Entry> entries);
}
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/SortImpl.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/SortImpl.java
index 8745683f6e..13bd7fbb0e 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/SortImpl.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/aggregator/SortImpl.java
@@ -25,12 +25,12 @@ import java.util.List;
import org.apache.tuscany.sca.data.collection.Entry;
import org.apache.tuscany.sca.data.collection.Item;
-import org.osoa.sca.annotations.Property;
+import org.oasisopen.sca.annotation.Property;
/**
* Implementation of a Feed Sort service component.
*
- * @version $Rev: 685663 $ $Date: 2008-08-13 13:11:20 -0700 (Wed, 13 Aug 2008) $
+ * @version $Rev$ $Date$
*/
public class SortImpl implements Sort {
diff --git a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/util/AtomTestCaseUtils.java
index 6beed6881f..ec79fb61b9 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/AtomTestCaseUtils.java
+++ b/java/sca/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/util/AtomTestCaseUtils.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.sca.binding.atom;
+package org.apache.tuscany.sca.binding.atom.util;
import java.io.IOException;
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
index a2c50f872e..fa80fc0a39 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
+++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Consumer.composite
@@ -17,8 +17,8 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace="http://customer"
name="Consumer">
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite
index 60097ee0f7..1297fb109b 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite
+++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/Provider.composite
@@ -17,8 +17,8 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace = "http://customer"
name="Provider">
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite
index ddb660cada..f8594ad6b1 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite
+++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ProviderNonCollection.composite
@@ -17,8 +17,8 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace = "http://customer"
name="ProviderNonCollection">
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite
index 71aa932a12..59466a419e 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite
+++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite
@@ -17,8 +17,8 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace = "http://receipt"
name="ReceiptProvider">
diff --git a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite
index 64c84c5440..fcaafd9c34 100644
--- a/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite
+++ b/java/sca/modules/binding-atom-runtime/src/test/resources/org/apache/tuscany/sca/binding/atom/aggregator/FeedAggregator.composite
@@ -17,8 +17,8 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
targetNamespace="http://aggregator"
name="FeedAggregator">