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 2007/12/11 15:36:17 UTC

svn commit: r603258 - in /incubator/tuscany/java/sca/modules/binding-jms: ./ src/test/java/org/apache/tuscany/sca/binding/jms/ src/test/resources/simple/ src/test/resources/wsdl/

Author: antelder
Date: Tue Dec 11 06:36:14 2007
New Revision: 603258

URL: http://svn.apache.org/viewvc?rev=603258&view=rev
Log:
Start adding a simple rpc style test as is being discussed on the ML

Added:
    incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java   (with props)
    incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCaseFIXME.java
      - copied, changed from r603208, incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase.java
    incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/
    incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/rpc.composite
Removed:
    incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase.java
    incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/wsdl/helloworld.wsdl
Modified:
    incubator/tuscany/java/sca/modules/binding-jms/pom.xml
    incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
    incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java

Modified: incubator/tuscany/java/sca/modules/binding-jms/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/pom.xml?rev=603258&r1=603257&r2=603258&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-jms/pom.xml Tue Dec 11 06:36:14 2007
@@ -63,6 +63,12 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-jms-activemq</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-implementation-java-runtime</artifactId>
             <version>1.1-incubating-SNAPSHOT</version>
             <scope>runtime</scope>

Modified: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java?rev=603258&r1=603257&r2=603258&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java (original)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java Tue Dec 11 06:36:14 2007
@@ -26,6 +26,7 @@
  */
 @Service(HelloWorldService.class)
 public class HelloWorldClientImpl implements HelloWorldService {
+
     private HelloWorldService serviceA;
 
     @Reference
@@ -33,18 +34,8 @@
         this.serviceA = service;
     }
     
-    private HelloWorldService serviceB;
-
-    @Reference
-    public void setServiceB(HelloWorldService service) {
-        this.serviceB = service;
-    }    
-
     public String sayHello(String name) {
-        return "ServiceA says " +
-                serviceA.sayHello(name + "-A") + 
-                " ServiceB says " +
-                serviceB.sayHello(name + "-B");
+        return serviceA.sayHello(name);
     }
     
    

Modified: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java?rev=603258&r1=603257&r2=603258&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java Tue Dec 11 06:36:14 2007
@@ -21,7 +21,7 @@
 public class HelloWorldServiceImpl implements HelloWorldService {
 
     public String sayHello(String name) {
-        return "Hello " + name;
+        return "jmsHello " + name;
     }
 
 }

Added: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java?rev=603258&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java (added)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java Tue Dec 11 06:36:14 2007
@@ -0,0 +1,52 @@
+/*
+ * 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 simple HelloWorld application.
+ */
+public class JMSTestCase2 {
+
+    private static SCADomain scaDomain;
+
+    @Before
+    public void init() {
+        scaDomain = SCADomain.newInstance("simple/rpc.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();
+        }
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase2.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCaseFIXME.java (from r603208, incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCaseFIXME.java?p2=incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCaseFIXME.java&p1=incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase.java&r1=603208&r2=603258&rev=603258&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSTestCaseFIXME.java Tue Dec 11 06:36:14 2007
@@ -30,7 +30,7 @@
 /**
  * This shows how to test the JMS binding using a simple HelloWorld application.
  */
-public class JMSTestCase {
+public class JMSTestCaseFIXME {
 
     private static BrokerService        broker;
     private static HelloWorldService    helloWorldService;

Added: incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/rpc.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/rpc.composite?rev=603258&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/rpc.composite (added)
+++ incubator/tuscany/java/sca/modules/binding-jms/src/test/resources/simple/rpc.composite Tue Dec 11 06:36:14 2007
@@ -0,0 +1,47 @@
+<?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="RPCComposite">
+
+    <component name="HelloWorldClient">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+        <reference name="serviceA">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+               <destination name="DestQueueA" create="always"/>
+               <response>
+                  <destination name="RespQueueA" create="always"/>
+               </response>
+            </binding.jms>  
+        </reference>
+    </component>        
+
+    <component name="HelloWorldService">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
+        <service name="HelloWorldService">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+               <destination name="DestQueueB" create="always"/>
+               <response>
+                  <destination name="RespQueueA" create="always"/>
+               </response>
+            </binding.jms>  
+        </service> 
+    </component>       
+
+</composite>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org