You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/10/06 12:15:47 UTC

svn commit: r822191 - in /tuscany/java/sca/itest/jms/rpc/src: main/resources/META-INF/ main/resources/simple/ test/ test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/tuscany/ test/java/org/apache/tuscany/sca/ test/java/org/apache/tus...

Author: antelder
Date: Tue Oct  6 10:15:46 2009
New Revision: 822191

URL: http://svn.apache.org/viewvc?rev=822191&view=rev
Log:
Separate out the rpc test from the jms geneal tests

Added:
    tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/
    tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
    tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/
    tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite
    tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite
    tuscany/java/sca/itest/jms/rpc/src/test/
    tuscany/java/sca/itest/jms/rpc/src/test/java/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/
    tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java

Added: tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml?rev=822191&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/java/sca/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml Tue Oct  6 10:15:46 2009
@@ -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

Added: tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite?rev=822191&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite (added)
+++ tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/client.composite Tue Oct  6 10:15:46 2009
@@ -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>

Added: tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite?rev=822191&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite (added)
+++ tuscany/java/sca/itest/jms/rpc/src/main/resources/simple/service.composite Tue Oct  6 10:15:46 2009
@@ -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>

Added: tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java?rev=822191&view=auto
==============================================================================
--- tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java (added)
+++ tuscany/java/sca/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java Tue Oct  6 10:15:46 2009
@@ -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();
+        }
+    }
+}