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 2008/01/05 17:09:21 UTC

svn commit: r609164 - in /incubator/tuscany/java/sca/itest/jms/src: main/resources/external/ main/resources/oneway/ main/resources/simple/ test/java/org/apache/tuscany/sca/binding/jms/

Author: antelder
Date: Sat Jan  5 08:09:19 2008
New Revision: 609164

URL: http://svn.apache.org/viewvc?rev=609164&view=rev
Log:
Itest for using an external jms broker

Added:
    incubator/tuscany/java/sca/itest/jms/src/main/resources/external/
    incubator/tuscany/java/sca/itest/jms/src/main/resources/external/client.composite
    incubator/tuscany/java/sca/itest/jms/src/main/resources/external/service.composite
    incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java   (with props)
Modified:
    incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayClient.composite
    incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayService.composite
    incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/client.composite
    incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/service.composite

Added: incubator/tuscany/java/sca/itest/jms/src/main/resources/external/client.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/external/client.composite?rev=609164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/external/client.composite (added)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/external/client.composite Sat Jan  5 08:09:19 2008
@@ -0,0 +1,38 @@
+<?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" />
+    </component>
+
+    <reference name="serviceA" promote="HelloWorldClient/serviceA">
+        <interface.java interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
+        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+            <destination name="DestQueueA"/>
+            <response>
+               <destination name="RespQueueA"/>
+            </response>
+        </binding.jms>  
+    </reference>
+
+</composite>

Added: incubator/tuscany/java/sca/itest/jms/src/main/resources/external/service.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/external/service.composite?rev=609164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/external/service.composite (added)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/external/service.composite Sat Jan  5 08:09:19 2008
@@ -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="RPCComposite">
+
+    <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="DestQueueA" create="always"/>
+               <response>
+                  <destination name="RespQueueA" create="always"/>
+               </response>
+            </binding.jms>  
+        </service> 
+    </component>       
+
+</composite>

Modified: incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayClient.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayClient.composite?rev=609164&r1=609163&r2=609164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayClient.composite (original)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayClient.composite Sat Jan  5 08:09:19 2008
@@ -27,7 +27,7 @@
 
     <reference name="serviceA" promote="OneWayClient/serviceA">
         <interface.java interface="org.apache.tuscany.sca.binding.jms.OneWayService" />
-        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61619">
             <destination name="DestQueueA"/>
         </binding.jms>  
     </reference>

Modified: incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayService.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayService.composite?rev=609164&r1=609163&r2=609164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayService.composite (original)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/oneway/OneWayService.composite Sat Jan  5 08:09:19 2008
@@ -23,7 +23,7 @@
     <component name="OneWayService">
         <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
         <service name="OneWayService">
-            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61619">
                <destination name="DestQueueA" create="always"/>
             </binding.jms>  
         </service> 

Modified: incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/client.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/client.composite?rev=609164&r1=609163&r2=609164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/client.composite (original)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/client.composite Sat Jan  5 08:09:19 2008
@@ -27,7 +27,7 @@
 
     <reference name="serviceA" promote="HelloWorldClient/serviceA">
         <interface.java interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
-        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61619">
             <destination name="DestQueueA"/>
             <response>
                <destination name="RespQueueA"/>

Modified: incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/service.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/service.composite?rev=609164&r1=609163&r2=609164&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/service.composite (original)
+++ incubator/tuscany/java/sca/itest/jms/src/main/resources/simple/service.composite Sat Jan  5 08:09:19 2008
@@ -23,7 +23,7 @@
     <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">
+            <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61619">
                <destination name="DestQueueA" create="always"/>
                <response>
                   <destination name="RespQueueA" create="always"/>

Added: incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java?rev=609164&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/jms/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java Sat Jan  5 08:09:19 2008
@@ -0,0 +1,68 @@
+/*
+ * 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.activemq.broker.BrokerService;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests using the JMS binding with an external JMS broker
+ */
+public class ExternalBrokerTestCase {
+
+    private static SCADomain scaDomain;
+    private BrokerService broker;
+
+    @Before
+    public void init() throws Exception {
+        startBroker();
+        scaDomain = SCADomain.newInstance("http://localhost", "/", "external/client.composite", "external/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() throws Exception {
+        if (scaDomain != null) {
+            scaDomain.close();
+        }
+        stopBroker();
+    }
+
+    protected void startBroker() throws Exception {
+        broker = new BrokerService();
+        broker.addConnector("tcp://localhost:61616");
+        broker.start();
+    }
+    protected void stopBroker() throws Exception {
+        if (broker != null) {
+            broker.stop();
+        }
+    }
+
+}

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

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



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