summaryrefslogtreecommitdiffstats
path: root/java/sca/itest/jms
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-06 10:15:46 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-06 10:15:46 +0000
commit282390d64f791d3d9d0f166bc836a7494b750c4b (patch)
tree74e724414413b617fe9064c48b1a7946af08718e /java/sca/itest/jms
parent3daddc138b1dd849f159036b9dff3e55a635e136 (diff)
Separate out the rpc test from the jms geneal tests
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@822191 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/itest/jms')
-rw-r--r--java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml24
-rw-r--r--java/sca/itest/jms/rpc/src/main/resources/simple/client.composite37
-rw-r--r--java/sca/itest/jms/rpc/src/main/resources/simple/service.composite37
-rw-r--r--java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java53
4 files changed, 151 insertions, 0 deletions
diff --git a/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..c062ef9ec0
--- /dev/null
+++ b/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?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:SimpleServiceComposite"/>
+ <deployable composite="itest:SimpleClientComposite"/>
+</contribution> \ No newline at end of file
diff --git a/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite b/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite
new file mode 100644
index 0000000000..bed860e2cd
--- /dev/null
+++ b/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite
@@ -0,0 +1,37 @@
+<?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.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="SimpleClientComposite">
+
+ <component name="HelloWorldClient">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms>
+ <destination jndiName="DestQueueA">
+ </destination>
+ <response>
+ <destination jndiName="RespQueueA"/>
+ </response>
+ </binding.jms>
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite b/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite
new file mode 100644
index 0000000000..01553a968c
--- /dev/null
+++ b/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite
@@ -0,0 +1,37 @@
+<?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.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="SimpleServiceComposite">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
+ <service name="HelloWorldService">
+ <binding.jms>
+ <destination jndiName="DestQueueA" create="always">
+ </destination>
+ <response>
+ <destination jndiName="RespQueueA" create="always"/>
+ </response>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java b/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
new file mode 100644
index 0000000000..3c0eb0791b
--- /dev/null
+++ b/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
@@ -0,0 +1,53 @@
+/*
+ * 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.jms;
+
+import static org.junit.Assert.assertEquals;
+
+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;
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class RPCTestCase {
+
+ private Node node;
+
+ @Before
+ public void init() {
+ node = NodeFactory.newInstance().createNode().start();
+ }
+
+ @Test
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldService helloWorldService = node.getService(HelloWorldService.class, "HelloWorldClient");
+ assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra"));
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}