axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r354964 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/transport/jms/ integration/test/org/apache/axis2/integration/ integration/test/org/apache/axis2/jms/
Date Thu, 08 Dec 2005 03:57:51 GMT
Author: dims
Date: Wed Dec  7 19:57:21 2005
New Revision: 354964

URL: http://svn.apache.org/viewcvs?rev=354964&view=rev
Log:
enable all tests in JMSEchoRawXMLTest

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml?rev=354964&r1=354963&r2=354964&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml Wed
Dec  7 19:57:21 2005
@@ -56,6 +56,12 @@
         <parameter name="port" locked="false">6060</parameter>
     </transportReceiver>
 
+    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener">
+        <parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter>
+        <parameter name="java.naming.factory.initial" locked="false">org.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
+    </transportReceiver>
+
     <!-- ================================================= -->
     <!-- Transport Outs -->
     <!-- ================================================= -->

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java?rev=354964&r1=354963&r2=354964&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
Wed Dec  7 19:57:21 2005
@@ -92,15 +92,27 @@
             JMSEndpoint endpoint = null;
             if (dest == null) {
                 Object destination = msgContext.getProperty(JMSConstants.DESTINATION);
-                if (destination == null)
+                
+                if(connector == null) {
+                    connector = (JMSConnector) msgContext.getProperty(JMSConstants.CONNECTOR);
+                }
+                if (destination == null && msgContext.getTo() != null) {
+                    String to = msgContext.getTo().getAddress();
+                    if (to != null) {
+                        JMSURLHelper url = new JMSURLHelper(to);
+                        destination = url.getDestination();
+                    }
+                }
+                if (destination == null) {
                     throw new AxisFault("noDestination");
+                }
 
-                connector = (JMSConnector) msgContext.getProperty(JMSConstants.CONNECTOR);
-
-                if (destination instanceof String)
+                
+                if (destination instanceof String)  {
                     endpoint = connector.createEndpoint((String) destination);
-                else
+                } else {
                     endpoint = connector.createEndpoint((Destination) destination);
+                }
             } else {
                 endpoint = connector.createEndpoint(dest);
             }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java?rev=354964&r1=354963&r2=354964&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
Wed Dec  7 19:57:21 2005
@@ -61,7 +61,7 @@
 
             HashMap connectorMap = new HashMap();
             HashMap cfMap = new HashMap();
-            String destination = "dynamicQueues/FOO.BAR";
+            String destination = "dynamicQueues/BAR";
             String username = null;
             String password = null;
             boolean doThreads = true;

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java?rev=354964&r1=354963&r2=354964&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
Wed Dec  7 19:57:21 2005
@@ -51,7 +51,7 @@
 
 public class JMSEchoRawXMLTest extends TestCase {
     private EndpointReference targetEPR =
-            new EndpointReference("jms:/dynamicQueues/FOO.BAR?ConnectionFactoryJNDIName=ConnectionFactory&java.naming.factory.initial=org.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616");
+            new EndpointReference("jms:/dynamicQueues/BAR?ConnectionFactoryJNDIName=ConnectionFactory&java.naming.factory.initial=org.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616");
     private QName serviceName = new QName("EchoXMLService");
     private QName operationName = new QName("echoOMElement");
 
@@ -112,10 +112,9 @@
         options.setTo(targetEPR);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
         options.setListenerTransportProtocol(Constants.TRANSPORT_JMS);
-        options.setUseSeparateListener(false);
         options.setAction(serviceName.getLocalPart());
         options.setSoapAction("echoOMElement");
-        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/FOO.BAR");
+        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/BAR");
         options.getProperties().put(JMSConstants.WAIT_FOR_RESPONSE, Boolean.TRUE);
         options.getProperties().put(JMSConstants._TIMEOUT_TIME, new Long(100000));
 
@@ -165,10 +164,9 @@
         options.setTo(targetEPR);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
         options.setListenerTransportProtocol(Constants.TRANSPORT_JMS);
-        options.setUseSeparateListener(false);
         options.setAction(serviceName.getLocalPart());
         options.setSoapAction("EchoXMLService/echoOMElement");
-        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/FOO.BAR");
+        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/BAR");
         options.getProperties().put(JMSConstants.WAIT_FOR_RESPONSE, Boolean.TRUE);
         options.getProperties().put(JMSConstants._TIMEOUT_TIME, new Long(100000));
 
@@ -180,38 +178,42 @@
         call.close();
     }
 
-//    public void testEchoXMLCompleteSync() throws Exception {
-//        AxisService service =
-//                Utils.createSimpleService(serviceName,
-//                        Echo.class.getName(),
-//                        operationName);
-//
-//        OMFactory fac = OMAbstractFactory.getOMFactory();
-//
-//        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
-//        OMElement payloadElement = fac.createOMElement("echoOMElement", omNs);
-//        OMElement value = fac.createOMElement("myValue", omNs);
-//        value.setText("Isaac Asimov, The Foundation Trilogy");
-//        payloadElement.addChild(value);
-//
-//        org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
-//                serviceContext);
-//        Options options = new Options();
-//        call.setClientOptions(options);
-//        options.setTo(targetEPR);
-//        call.engageModule(new QName(Constants.MODULE_ADDRESSING));
-//        options.setAction(operationName.getLocalPart());
-//        options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
-//        options.setUseSeparateListener(true);
-//
-//        OMElement result = call.invokeBlocking(
-//                operationName.getLocalPart(), payloadElement);
-//        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
-//                System.out));
-//        call.close();
-//
-//    }
-//
+    public void testEchoXMLCompleteSync() throws Exception {
+        AxisService service =
+                Utils.createSimpleService(serviceName,
+                        Echo.class.getName(),
+                        operationName);
+
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+
+        OMNamespace omNs = fac.createOMNamespace("http://localhost/axis2/services/EchoXMLService",
"my");
+        OMElement payloadElement = fac.createOMElement("echoOMElement", omNs);
+        OMElement value = fac.createOMElement("myValue", omNs);
+        value.setText("Isaac Asimov, The Foundation Trilogy");
+        payloadElement.addChild(value);
+
+        org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
+                serviceContext);
+        Options options = new Options();
+        call.setClientOptions(options);
+        options.setTo(targetEPR);
+        call.engageModule(new QName(Constants.MODULE_ADDRESSING));
+        options.setAction(operationName.getLocalPart());
+        options.setListenerTransportProtocol(Constants.TRANSPORT_JMS);
+        options.setSoapAction("EchoXMLService/echoOMElement");
+        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/BAR");
+        options.getProperties().put(JMSConstants.WAIT_FOR_RESPONSE, Boolean.FALSE);
+        options.getProperties().put(JMSConstants._TIMEOUT_TIME, new Long(100000));
+        options.setUseSeparateListener(true);
+
+        OMElement result = call.invokeBlocking(
+                operationName.getLocalPart(), payloadElement);
+        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
+                System.out));
+        call.close();
+
+    }
+
     public void testEchoXMLSyncMC() throws Exception {
         ConfigurationContextFactory confac = new ConfigurationContextFactory();
         ConfigurationContext configContext = confac.buildClientConfigurationContext(Constants.TESTING_REPOSITORY);
@@ -223,9 +225,8 @@
         options.setTo(targetEPR);
         options.setAction(operationName.getLocalPart());
         options.setListenerTransportProtocol(Constants.TRANSPORT_JMS);
-        options.setUseSeparateListener(false);
         options.setSoapAction("EchoXMLService/echoOMElement");
-        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/FOO.BAR");
+        options.getProperties().put(JMSConstants.DESTINATION, "dynamicQueues/BAR");
         options.getProperties().put(JMSConstants.WAIT_FOR_RESPONSE, Boolean.TRUE);
         options.getProperties().put(JMSConstants._TIMEOUT_TIME, new Long(100000));
 



Mime
View raw message