Author: antelder
Date: Thu Feb 12 08:18:27 2009
New Revision: 743651

URL: http://svn.apache.org/viewvc?rev=743651&view=rev
Log:
Add jms itest using a response ConnectionFactory

Added:
    tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/
    
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/client.composite
    
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/service.composite
    
tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java

Added: 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/client.composite
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/client.composite?rev=743651&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/client.composite 
(added)
+++ 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/client.composite 
Thu Feb 12 08:18:27 2009
@@ -0,0 +1,39 @@
+<?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://www.osoa.org/xmlns/sca/1.0";
+           name="SimpleClientComposite">
+
+    <component name="HelloWorldClient">
+        <implementation.java 
class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+        <reference name="serviceA" />
+    </component>
+
+    <reference name="serviceA" promote="HelloWorldClient/serviceA">
+        <interface.java 
interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
+        <binding.jms>
+            <destination name="DestQueueA"/>
+            <response>
+               <connectionFactory name="ResponseCF"/>
+               <destination name="RespQueueA"/>
+            </response>
+        </binding.jms>  
+    </reference>
+
+</composite>

Added: 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/service.composite
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/service.composite?rev=743651&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/service.composite 
(added)
+++ 
tuscany/branches/sca-java-1.x/itest/jms/src/main/resources/cf/service.composite 
Thu Feb 12 08:18:27 2009
@@ -0,0 +1,35 @@
+<?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://www.osoa.org/xmlns/sca/1.0";
+           name="SimpleServiceComposite">
+
+    <component name="HelloWorldService">
+        <implementation.java 
class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
+        <service name="HelloWorldService">
+            <binding.jms>
+               <destination name="DestQueueA" create="always"/>
+               <response>
+                  <destination name="RespQueueA" create="always"/>
+               </response>
+            </binding.jms>  
+        </service> 
+    </component>       
+
+</composite>

Added: 
tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java?rev=743651&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
 Thu Feb 12 08:18:27 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.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This shows how to test the JMS binding using a response ConnectionFactory
+ */
+public class ResponseCFTestCase {
+
+    private static SCADomain scaDomain;
+
+    @Before
+    public void init() {
+        scaDomain =
+            SCADomain.newInstance("http://localhost";, "/", 
"cf/client.composite", "cf/service.composite");
+    }
+
+    @Test
+    public void testHelloWorldCreate() throws Exception {
+        HelloWorldService helloWorldService = 
scaDomain.getService(HelloWorldService.class, "HelloWorldClient");
+        assertEquals("jmsHello Petra", helloWorldService.sayHello("Petra"));
+    }
+
+    @After
+    public void end() {
+        if (scaDomain != null) {
+            scaDomain.close();
+        }
+    }
+}


Reply via email to