summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-09-14 12:14:52 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-09-14 12:14:52 +0000
commit211ce51319e5fb81b48669b51c590ee31e119461 (patch)
tree4ab7affcf8769b397fe4c759bd7d8255562f4703
parente0256f27e5cba40f5251113902e7f9d9e7908878 (diff)
Bring up the JMS TTL test as its a nice simple one to start with. This shows all the changes required to convert the test from 1.x to 2.x
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@814600 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/itest/jms/ttl/pom.xml28
-rw-r--r--java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java4
-rw-r--r--java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java2
-rw-r--r--java/sca/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--java/sca/itest/jms/ttl/src/main/resources/ttl.composite11
-rw-r--r--java/sca/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java13
6 files changed, 45 insertions, 36 deletions
diff --git a/java/sca/itest/jms/ttl/pom.xml b/java/sca/itest/jms/ttl/pom.xml
index b87e6b55ec..bf1a50a64f 100644
--- a/java/sca/itest/jms/ttl/pom.xml
+++ b/java/sca/itest/jms/ttl/pom.xml
@@ -22,51 +22,37 @@
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
<artifactId>itest-jms-ttl</artifactId>
<name>Apache Tuscany SCA iTest JMS Time To Live</name>
- <repositories>
- <repository>
- <id>apache.incubator</id>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- </repository>
- </repositories>
-
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-sca-api</artifactId>
- <version>1.6-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-jms-asf</artifactId>
- <version>1.6-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
@@ -79,7 +65,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-node-impl</artifactId>
- <version>1.6-SNAPSHOT</version>
+ <version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
diff --git a/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java b/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
index 0819e8474f..dc6577b7e1 100644
--- a/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
+++ b/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
@@ -19,8 +19,8 @@
package org.apache.tuscany.sca.binding.jms;
-import org.osoa.sca.annotations.OneWay;
-import org.osoa.sca.annotations.Remotable;
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
@Remotable
public interface ClientIface {
diff --git a/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
index 4467d91f0d..4f9908f062 100644
--- a/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
+++ b/java/sca/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
@@ -18,7 +18,7 @@
*/
package org.apache.tuscany.sca.binding.jms;
-import org.osoa.sca.annotations.Reference;
+import org.oasisopen.sca.annotation.Reference;
/**
* This class implements the OneWay service.
diff --git a/java/sca/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..eeae8fcc59
--- /dev/null
+++ b/java/sca/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:TTLTests"/>
+</contribution> \ No newline at end of file
diff --git a/java/sca/itest/jms/ttl/src/main/resources/ttl.composite b/java/sca/itest/jms/ttl/src/main/resources/ttl.composite
index 9065148c0f..91b64cf8dc 100644
--- a/java/sca/itest/jms/ttl/src/main/resources/ttl.composite
+++ b/java/sca/itest/jms/ttl/src/main/resources/ttl.composite
@@ -17,18 +17,17 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://jms"
- xmlns:itest="http://jms"
- name="DefinitionsTests">
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="TTLTests">
<component name="Client1">
<implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
<reference name="serviceA">
<interface.java interface="org.apache.tuscany.sca.binding.jms.ClientIface" />
<binding.jms >
- <destination name="dynamic/MyService"/>
- <headers JMSTimeToLive="123" />
+ <destination jndiName="dynamic/MyService"/>
+ <headers timeToLive="123" />
</binding.jms>
</reference>
</component>
diff --git a/java/sca/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java b/java/sca/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
index 70b945798b..a72bde2f76 100644
--- a/java/sca/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
+++ b/java/sca/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
@@ -22,7 +22,8 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import itest.MockInitialContextFactory;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -31,16 +32,16 @@ import org.junit.Test;
*/
public class TTLTestCase {
- private static SCADomain scaDomain;
+ private Node node;
@Before
public void init() {
- scaDomain = SCADomain.newInstance("http://localhost", "/", "ttl.composite");
+ node = NodeFactory.newInstance().createNode().start();
}
@Test
public void testSayHello() throws Exception {
- ClientIface client1 = scaDomain.getService(ClientIface.class, "Client1");
+ ClientIface client1 = node.getService(ClientIface.class, "Client1");
client1.sayHello("petra");
@@ -56,8 +57,8 @@ public class TTLTestCase {
@After
public void end() {
- if (scaDomain != null) {
- scaDomain.close();
+ if (node != null) {
+ node.stop();
}
}
}