axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r447298 - in /webservices/axis2/trunk/java/modules: integration/ integration/test/org/apache/axis2/integration/ integration/test/org/apache/axis2/jms/ java2wsdl/ kernel/conf/ kernel/src/org/apache/axis2/engine/ kernel/src/org/apache/axis2/t...
Date Mon, 18 Sep 2006 07:15:09 GMT
Author: dims
Date: Mon Sep 18 00:15:08 2006
New Revision: 447298

URL: http://svn.apache.org/viewvc?view=rev&rev=447298
Log:
- Remove generated target directory 
- Remove unnecessary dependency in java2wsdl pom
- Get JMSEchoRawXMLTest test case working with njms package
- Fix an NPE in AxisEngine
- Remove unused constant in HTTPConstants.java
- Fix getEPRsForService in njms/JMSListener
- Most importantly, download activemq and run the unit test always.

Next step: make sure nothing is broken, get rid of jms/* and then rename njms to jms.


Removed:
    webservices/axis2/trunk/java/modules/tool/axis2-java2wsdl-maven-plugin/src/test/test1/target/
Modified:
    webservices/axis2/trunk/java/modules/integration/project.xml
    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
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-client-axis2.xml
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-server-axis2.xml
    webservices/axis2/trunk/java/modules/java2wsdl/pom.xml
    webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/njms/JMSListener.java

Modified: webservices/axis2/trunk/java/modules/integration/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/project.xml?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/project.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/project.xml Mon Sep 18 00:15:08 2006
@@ -333,6 +333,11 @@
 	  <version>${log4j.version}</version>
 	</dependency>
         <dependency>
+          <groupId>activemq</groupId>
+          <artifactId>activemq</artifactId>
+          <version>4.0.1</version>
+        </dependency>
+        <dependency>
             <groupId>springframework</groupId>
             <artifactId>spring-core</artifactId>
             <version>${spring.version}</version>
@@ -394,7 +399,6 @@
                 <exclude>**/*InteropStubTest.class</exclude>
                 <exclude>**org/apache/axis2/mail/*.class</exclude>
 		<exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.class</exclude>
-                <exclude>**org/apache/axis2/jms/*.class</exclude>
                 <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.class</exclude>
                 <exclude>**/ScenarioST1Test.class</exclude>
                 <exclude>**/samples/wsdl/perf2/*.class</exclude>

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsJMSServer.java?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- 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
Mon Sep 18 00:15:08 2006
@@ -17,24 +17,25 @@
 package org.apache.axis2.integration;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.engine.ListenerManager;
+import org.apache.axis2.transport.njms.JMSListener;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.transport.jms.JNDIVendorAdapter;
-import org.apache.axis2.transport.jms.SimpleJMSListener;
+import org.apache.axis2.description.TransportInDescription;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.activemq.broker.BrokerService;
 
 import javax.xml.namespace.QName;
 import java.io.File;
 import java.util.HashMap;
 
 public class UtilsJMSServer {
-    private static int count = 0;
-
-    private static SimpleJMSListener receiver;
+    private static JMSListener receiver;
 
     public static final int TESTING_PORT = 5555;
 
@@ -60,52 +61,37 @@
     }
 
     public static synchronized void start() throws Exception {
-        if (count == 0) {
-
-            HashMap connectorMap = new HashMap();
-            HashMap cfMap = new HashMap();
-            String destination = "dynamicQueues/BAR";
-            String username = null;
-            String password = null;
-            boolean doThreads = true;
-
-            cfMap.put(JNDIVendorAdapter.CONTEXT_FACTORY,
-                    "org.activemq.jndi.ActiveMQInitialContextFactory");
-            cfMap.put(JNDIVendorAdapter.PROVIDER_URL, "tcp://localhost:61616");
-
-            // start JMS server
+            // start JMS Listener
             File file = new File(REPOSITORY_JMS);
             System.out.println(file.getAbsoluteFile());
             if (!file.exists()) {
                 throw new Exception("Repository directory does not exist");
             }
 
-            ConfigurationContext er = ConfigurationContextFactory.createConfigurationContextFromFileSystem(file
+            ConfigurationContext configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(file
                     .getAbsolutePath(),REPOSITORY_JMS + "/conf/axis2.xml");
             try {
                 Thread.sleep(2000);
             } catch (InterruptedException e1) {
                 throw new AxisFault("Thread interuptted", e1);
             }
-            receiver = new SimpleJMSListener(
-                    REPOSITORY_JMS,
-                    connectorMap, cfMap, destination, username, password,
-                    doThreads);
+            receiver = new JMSListener();
+            ListenerManager listenerManager = configurationContext.getListenerManager();
+            TransportInDescription trsIn = configurationContext.getAxisConfiguration().getTransportIn(new
QName(Constants.TRANSPORT_JMS));
+            trsIn.setReceiver(receiver);
+            if (listenerManager == null) {
+                listenerManager = new ListenerManager();
+                listenerManager.init(configurationContext);
+            }
+            listenerManager.addListener(trsIn, true);
+            receiver.init(configurationContext, trsIn);
             receiver.start();
-
-        }
-        count++;
     }
 
     public static synchronized void stop() {
         try {
-            if (count == 1) {
                 receiver.stop();
-                count = 0;
                 System.out.print("Server stopped .....");
-            } else {
-                count--;
-            }
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/JMSEchoRawXMLTest.java?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- 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
Mon Sep 18 00:15:08 2006
@@ -23,15 +23,15 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.transport.njms.JMSConstants;
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.async.AsyncResult;
 import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.context.ConfigurationContext;
@@ -40,27 +40,29 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.OutInAxisOperation;
-import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.Echo;
 import org.apache.axis2.integration.UtilServer;
 import org.apache.axis2.integration.UtilsJMSServer;
 import org.apache.axis2.util.Utils;
+import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.activemq.broker.BrokerService;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamException;
 
 public class JMSEchoRawXMLTest extends TestCase {
     private EndpointReference targetEPR =
-            new EndpointReference("jms:/dynamicQueues/BAR?ConnectionFactoryJNDIName=ConnectionFactory&java.naming.factory.initial=org.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616");
+            new EndpointReference("jms:/EchoXMLService?"+JMSConstants.CONFAC_JNDI_NAME_PARAM+"=ConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616");
     private QName serviceName = new QName("EchoXMLService");
     private QName operationName = new QName("echoOMElement");
 
-    private AxisService service;
+
+    String destination = "EchoXMLService";
+    BrokerService broker = new BrokerService();
+
     private AxisService clientService;
     private ConfigurationContext configContext;
 
@@ -76,13 +78,21 @@
     }
 
     protected void setUp() throws Exception {
+        // Start ActiveMQ embedded broker
+        broker.addConnector("tcp://localhost:61616");
+        broker.start();
+
         UtilsJMSServer.start();
 
         //create and deploy the service
-        service =
-                Utils.createSimpleService(serviceName,
-                        Echo.class.getName(),
-                        operationName);
+        AxisService service = Utils.createSimpleService(serviceName,
+                Echo.class.getName(),
+                operationName);
+        service.getExposedTransports().add(Constants.TRANSPORT_JMS);
+        Parameter param = new Parameter();
+        param.setName(JMSConstants.DEST_PARAM);
+        param.setValue(destination);
+        service.getParameters().add(param);
         UtilsJMSServer.deployService(service);
         clientService = Utils.createSimpleServiceforClient(serviceName,
                 Echo.class.getName(),
@@ -92,6 +102,7 @@
 
     protected void tearDown() throws Exception {
         UtilsJMSServer.stop();
+        broker.stop();
     }
 
     private OMElement createPayload() {
@@ -190,7 +201,7 @@
                 System.out));
 
     }
-
+    
     public void testEchoXMLSyncMC() throws Exception {
         ConfigurationContext configContext =
                 ConfigurationContextFactory.createConfigurationContextFromFileSystem(Constants.TESTING_REPOSITORY,
Constants.TESTING_REPOSITORY + "/conf/axis2.xml");

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-client-axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-client-axis2.xml?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-client-axis2.xml
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-client-axis2.xml
Mon Sep 18 00:15:08 2006
@@ -60,13 +60,15 @@
         <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
     </transportReceiver>
 
-    <!--Uncomment this if you want JMS transport support-->
-    <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 name="jms" class="org.apache.axis2.transport.njms.JMSListener">
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
       	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
     </transportReceiver>
 
+
     <!-- ================================================= -->
     <!-- Transport Outs -->
     <!-- ================================================= -->
@@ -76,7 +78,7 @@
     <transportSender name="local"
                      class="org.apache.axis2.transport.local.LocalTransportSender"/>
     <transportSender name="jms"
-                     class="org.apache.axis2.transport.jms.JMSSender"/>
+                     class="org.apache.axis2.transport.njms.JMSSender"/>
     <transportSender name="http"
                      class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-server-axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-server-axis2.xml?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-server-axis2.xml
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/jms/jms-enabled-server-axis2.xml
Mon Sep 18 00:15:08 2006
@@ -60,13 +60,13 @@
         <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
     </transportReceiver>
 
-    <!--Uncomment this if you want JMS transport support-->
-    <!--<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>-->
+    <transportReceiver name="jms" class="org.apache.axis2.transport.njms.JMSListener">
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
       	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>
 
     <!-- ================================================= -->
     <!-- Transport Outs -->
@@ -77,7 +77,7 @@
     <transportSender name="local"
                      class="org.apache.axis2.transport.local.LocalTransportSender"/>
     <transportSender name="jms"
-                     class="org.apache.axis2.transport.jms.JMSSender"/>
+                     class="org.apache.axis2.transport.njms.JMSSender"/>
     <transportSender name="http"
                      class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>

Modified: webservices/axis2/trunk/java/modules/java2wsdl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/pom.xml?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/pom.xml Mon Sep 18 00:15:08 2006
@@ -65,10 +65,6 @@
       <artifactId>mail</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jms_1.1_spec</artifactId>
-    </dependency>
-    <dependency>
       <groupId>jaxen</groupId>
       <artifactId>jaxen</artifactId>
     </dependency>

Modified: webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Mon Sep 18 00:15:08 2006
@@ -128,6 +128,8 @@
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
         <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
     </transportSender>
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.njms.JMSSender"/>
 
     <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport
Receiver
    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
Mon Sep 18 00:15:08 2006
@@ -630,6 +630,9 @@
 
             // write the Message to the Wire
             TransportOutDescription transportOut = msgContext.getTransportOut();
+            if(transportOut == null) {
+                throw new AxisFault("Transport out has not been set");
+            }
             TransportSender sender = transportOut.getSender();
             // This boolean property only used in client side fireAndForget invocation
             //It will set a property into message context and if some one has set the

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
Mon Sep 18 00:15:08 2006
@@ -271,11 +271,6 @@
     public static final String HEADER_COOKIE = "Cookie";
 
     /**
-     * Field HEADER_CONTENT_TYPE_JMS
-     */
-    public static final String HEADER_CONTENT_TYPE_JMS = "ContentType";
-
-    /**
      * Field HEADER_CONTENT_TYPE
      */
     public static final String HEADER_CONTENT_TYPE = "Content-Type";

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/njms/JMSListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/njms/JMSListener.java?view=diff&rev=447298&r1=447297&r2=447298
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/njms/JMSListener.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/njms/JMSListener.java
Mon Sep 18 00:15:08 2006
@@ -117,7 +117,6 @@
 
         while (services.hasNext()) {
             AxisService service = (AxisService) services.next();
-            boolean process = service.isEnableAllTransports();
             if (JMSUtils.isJMSService(service)) {
                 processService(service);
             }
@@ -323,7 +322,11 @@
      * @throws AxisFault not used
      */
     public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault
{
-          return new EndpointReference[]{new EndpointReference((String) serviceNameToEprMap.get(serviceName))};
+        //Strip out the operation name
+        if (serviceName.indexOf('/') != -1) {
+            serviceName = serviceName.substring(0, serviceName.indexOf('/'));
+        }
+        return new EndpointReference[]{new EndpointReference((String) serviceNameToEprMap.get(serviceName))};
     }
 
     /**
@@ -464,5 +467,9 @@
 
         public void serviceGroupUpdate(AxisEvent event, AxisServiceGroup serviceGroup) {
         }
+    }
+
+    public ConfigurationContext getConfigurationContext() {
+        return this.axisConf;
     }
 }



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


Mime
View raw message