cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ulhasbh...@apache.org
Subject svn commit: r679247 - in /cxf/trunk: rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/resources/META-INF/cxf/ rt/transports/jms/src/main/resources/schemas/wsdl/ systests/src/test/java/org/apache/cxf/systest/jms/ ...
Date Thu, 24 Jul 2008 00:37:00 GMT
Author: ulhasbhole
Date: Wed Jul 23 17:37:00 2008
New Revision: 679247

URL: http://svn.apache.org/viewvc?rev=679247&view=rev
Log:
* Fix for JIRA : https://issues.apache.org/jira/browse/CXF-1701 and https://issues.apache.org/jira/browse/CXF-1704
* Removed dead methods from JMSTransportBase.
* Updated System Test.


Added:
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java  
(with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java   (with
props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
  (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java   (with
props)
Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSProviderHub.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
    cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/extensions.xml
    cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterByteMessageImpl.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
    cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
    cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSProviderHub.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSProviderHub.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSProviderHub.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSProviderHub.java
Wed Jul 23 17:37:00 2008
@@ -23,6 +23,7 @@
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.QueueConnectionFactory;
+import javax.jms.Session;
 import javax.jms.TopicConnectionFactory;
 import javax.naming.Context;
 import javax.naming.NamingException;
@@ -65,13 +66,14 @@
         throws JMSException, NamingException {
 
         AddressType  addrDetails = jmsTransport.getJMSAddress();
+        boolean isQueue = JMSConstants.JMS_QUEUE.equals(addrDetails.getDestinationStyle().value());
       
         // get JMS connection resources and destination
         //
         Context context = JMSUtils.getInitialContext(addrDetails);
         Connection connection = null;
         
-        if (JMSConstants.JMS_QUEUE.equals(addrDetails.getDestinationStyle().value())) {
+        if (isQueue) {
             QueueConnectionFactory qcf =
                 (QueueConnectionFactory)context.lookup(addrDetails.getJndiConnectionFactoryName());
             if (addrDetails.isSetConnectionUserName()) {
@@ -100,11 +102,47 @@
         }
         connection.start();
 
-        Destination requestDestination = 
-                (Destination)context.lookup(addrDetails.getJndiDestinationName());
-
-        Destination replyDestination = (null != addrDetails.getJndiReplyDestinationName())
-            ? (Destination)context.lookup(addrDetails.getJndiReplyDestinationName()) : null;
+        Destination requestDestination = null;
+        try {
+            //see if jndiDestination is set
+            if (addrDetails.getJndiDestinationName() != null) {
+                requestDestination = 
+                    (Destination)context.lookup(addrDetails.getJndiDestinationName());  
 
+            }
+            
+            //if no jndiDestination or it fails see if jmsDestination is set and try to create
it.
+            if (requestDestination == null && addrDetails.getJmsDestinationName()
!= null) {
+                if (isQueue) {
+                    requestDestination = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
+                        .createQueue(addrDetails.getJmsDestinationName());    
+                } else {
+                    requestDestination = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
+                        .createTopic(addrDetails.getJmsDestinationName());
+                }
+            }
+            
+            if (requestDestination == null) {
+                //fail to locate or create requestDestination throw Exception.
+                throw new JMSException("Failed to lookup or create requestDestination");
+            }
+            
+        } catch (NamingException ne) {
+            //Propogate NamingException.
+            throw ne;
+        }
+         
+        Destination replyDestination = null;
+        
+        //Reply Destination is used (if present) only if the session is point-to-point session

+        if (isQueue) {
+            if (addrDetails.getJndiReplyDestinationName() != null) {
+                replyDestination = (Destination)context.lookup(addrDetails.getJndiReplyDestinationName());
+            } 
+            if (replyDestination == null && addrDetails.getJmsReplyDestinationName()
!= null) {
+                replyDestination = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
+                    .createQueue(addrDetails.getJmsReplyDestinationName());
+            }
+        }
 
         // create session factory to manage session, reply destination,
         // producer and consumer pooling

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
Wed Jul 23 17:37:00 2008
@@ -231,21 +231,6 @@
         }
     }
     
-    protected String getAddrUriFromJMSAddrPolicy() {
-        AddressType jmsAddressPolicy = transport.getJMSAddress();
-        return "jms:" + jmsAddressPolicy.getJndiConnectionFactoryName() 
-                        + "#"
-                        + jmsAddressPolicy.getJndiDestinationName();
-    }
-    
-    protected String getReplyTotAddrUriFromJMSAddrPolicy() {
-        AddressType jmsAddressPolicy = transport.getJMSAddress();
-        return "jms:" 
-                        + jmsAddressPolicy.getJndiConnectionFactoryName() 
-                        + "#"
-                        + jmsAddressPolicy.getJndiReplyDestinationName();
-    }
-
     protected boolean isDestinationStyleQueue() {
         return JMSConstants.JMS_QUEUE.equals(
             transport.getJMSAddress().getDestinationStyle().value());

Modified: cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/extensions.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/extensions.xml?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/extensions.xml (original)
+++ cxf/trunk/rt/transports/jms/src/main/resources/META-INF/cxf/extensions.xml Wed Jul 23
17:37:00 2008
@@ -23,4 +23,7 @@
     <entry key="org.apache.cxf.transport.jms-1">javax.wsdl.Port=org.apache.cxf.transport.jms.AddressType</entry>
     <entry key="org.apache.cxf.transport.jms-2">javax.wsdl.Port=org.apache.cxf.transport.jms.ClientBehaviorPolicyType</entry>
     <entry key="org.apache.cxf.transport.jms-3">javax.wsdl.Port=org.apache.cxf.transport.jms.ServerBehaviorPolicyType</entry>
+    <entry key="org.apache.cxf.transport.jms-4">javax.wsdl.Port=org.apache.cxf.transport.jms.ClientConfig</entry>
+    <entry key="org.apache.cxf.transport.jms-5">javax.wsdl.Port=org.apache.cxf.transport.jms.ServerConfig</entry>
+    <entry key="org.apache.cxf.transport.jms-6">javax.wsdl.Port=org.apache.cxf.transport.jms.SessionPoolType</entry>
 </properties>

Modified: cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd (original)
+++ cxf/trunk/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd Wed Jul 23 17:37:00
2008
@@ -33,23 +33,36 @@
     <xs:element name="clientConfig" type="jms:ClientConfig"/>
     <xs:element name="serverConfig" type="jms:ServerConfig"/>
     <xs:element name="address" type="jms:AddressType"/>
+    <xs:element name="sessionPool" type="jms:SessionPoolType"/>
 
     <xs:complexType name="SessionPoolType">
         <xs:annotation>
             <xs:documentation>JMS Session pool configuration policy</xs:documentation>
         </xs:annotation>
-        <xs:attribute name="lowWaterMark" type="xs:int" default="20"/>
-        <xs:attribute name="highWaterMark" type="xs:int" default="500" />
+        <xs:complexContent>
+            <xs:extension base="wsdl:tExtensibilityElement">
+        		<xs:attribute name="lowWaterMark" type="xs:int" default="20"/>
+        		<xs:attribute name="highWaterMark" type="xs:int" default="500" />
+        	</xs:extension>
+		</xs:complexContent>
     </xs:complexType>
     
     <xs:complexType name="ClientConfig">
-        <xs:attribute name="clientReceiveTimeout" type="xs:long" default="2000"/>
-        <xs:attribute name="messageTimeToLive" type="xs:long" default="0" />
+        <xs:complexContent>
+            <xs:extension base="wsdl:tExtensibilityElement">  
+				<xs:attribute name="clientReceiveTimeout" type="xs:long" default="2000"/>
+        		<xs:attribute name="messageTimeToLive" type="xs:long" default="0" />
+        	</xs:extension>
+		</xs:complexContent>        	
     </xs:complexType>
     
     <xs:complexType name="ServerConfig">
-        <xs:attribute name="messageTimeToLive" type="xs:long" default="0" />
-        <xs:attribute name="durableSubscriptionClientId" type="xs:string" />
+		<xs:complexContent>
+            <xs:extension base="wsdl:tExtensibilityElement">
+        		<xs:attribute name="messageTimeToLive" type="xs:long" default="0" />
+        		<xs:attribute name="durableSubscriptionClientId" type="xs:string" />
+			</xs:extension>
+		</xs:complexContent>        	
     </xs:complexType>
 
     <xs:complexType name="JMSPropertyType">
@@ -132,6 +145,7 @@
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
+                
                 <xs:attribute name="jndiConnectionFactoryName" type="xs:string" use="required">
                     <xs:annotation>
                         <xs:documentation>
@@ -139,13 +153,22 @@
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
-                <xs:attribute name="jndiDestinationName" type="xs:string" use="required">
+                <xs:attribute name="jndiDestinationName" type="xs:string">
                     <xs:annotation>
                         <xs:documentation>
                           Name of the JNDI Destination queue or topic.
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
+                
+                <xs:attribute name="jmsDestinationName" type="xs:string">
+                	<xs:annotation>
+                		<xs:documentation>
+                			JMS destination queue name or topic name.
+                		</xs:documentation>
+                	</xs:annotation>
+                </xs:attribute>
+                
                 <xs:attribute name="jndiReplyDestinationName" type="xs:string">
                     <xs:annotation>
                         <xs:documentation>
@@ -153,6 +176,15 @@
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>
+                
+                <xs:attribute name="jmsReplyDestinationName" type="xs:string">
+                	<xs:annotation>
+                		<xs:documentation>
+                			JMS Replyto destination queue name when using static queues for reply.
+                		</xs:documentation>
+                	</xs:annotation>
+                </xs:attribute>
+                
                 <xs:attribute name="connectionUserName" type="xs:string">
                     <xs:annotation>
                         <xs:documentation>

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterByteMessageImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterByteMessageImpl.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterByteMessageImpl.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterByteMessageImpl.java
Wed Jul 23 17:37:00 2008
@@ -18,21 +18,8 @@
  */
 package org.apache.cxf.systest.jms;
 
-import javax.annotation.Resource;
 import javax.jws.WebService;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
 
-import org.apache.cxf.hello_world_jms.BadRecordLitFault;
-import org.apache.cxf.hello_world_jms.HelloWorldPortType;
-import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
-import org.apache.cxf.hello_world_jms.types.BadRecordLit;
-import org.apache.cxf.hello_world_jms.types.ErrorCode;
-import org.apache.cxf.hello_world_jms.types.NoSuchCodeLit;
-import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
-import org.apache.cxf.transport.jms.JMSConstants;
-import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
 
 
 
@@ -41,57 +28,6 @@
             endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
             targetNamespace = "http://cxf.apache.org/hello_world_jms",
             wsdlLocation = "testutils/jms_test.wsdl")
-public class GreeterByteMessageImpl implements HelloWorldPortType {
-    @Resource
-    protected WebServiceContext wsContext;
-    public String greetMe(String me) {
-        MessageContext mc = wsContext.getMessageContext();
-        JMSMessageHeadersType headers =
-            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
-        System.out.println("get the message headers JMSCorrelationID" + headers.getJMSCorrelationID());
-        System.out.println("Reached here :" + me);
-        
-        // set reply header custom property
-        JMSPropertyType testProperty = new JMSPropertyType();
-        testProperty.setName("Test_Prop");
-        testProperty.setValue("some return value "  + me);
-        
-        System.out.println("found property in request headers at index: " 
-                           + headers.getProperty().indexOf(testProperty));
-        
-        JMSMessageHeadersType responseHeaders =
-            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(testProperty);
-        
-        return "Hello " + me;
-    }
-
-    public String sayHi() {        
-        return "Bonjour";
-    }
-    
-    public void greetMeOneWay(String requestType) {
-        System.out.println("*********  greetMeOneWay: " + requestType);
-    }
-    
-    public TestRpcLitFaultResponse testRpcLitFault(String faultType) 
-        throws BadRecordLitFault, NoSuchCodeLitFault {
-        BadRecordLit badRecord = new BadRecordLit();
-        badRecord.setReason("BadRecordLitFault");
-        if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
-            throw new BadRecordLitFault("TestBadRecordLit", badRecord);
-        }
-        if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
-            ErrorCode ec = new ErrorCode();
-            ec.setMajor((short)1);
-            ec.setMinor((short)1);
-            NoSuchCodeLit nscl = new NoSuchCodeLit();
-            nscl.setCode(ec);
-            throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
-        }
-        
-        return new TestRpcLitFaultResponse();
-    }
-    
+public class GreeterByteMessageImpl extends TwoWayJMSImplBase {    
     
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java Wed Jul
23 17:37:00 2008
@@ -20,38 +20,12 @@
 
 import javax.jws.WebService;
 
-import org.apache.hello_world_doc_lit.Greeter;
-import org.apache.hello_world_doc_lit.PingMeFault;
-import org.apache.hello_world_doc_lit.types.FaultDetail;
-
 
 @WebService(serviceName = "SOAPService2", 
             portName = "SoapPort2", 
             endpointInterface = "org.apache.hello_world_doc_lit.Greeter",
             targetNamespace = "http://apache.org/hello_world_doc_lit",
             wsdlLocation = "testutils/hello_world_doc_lit.wsdl")
-public class GreeterImplDoc implements Greeter {
-
-    public String sayHi() {
-        System.out.println("Call sayHi here ");
-        return "Bonjour";
-    }
-
-    public String greetMe(String requestType) {
-        System.out.println("Reached here :" + requestType);
-        return "Hello " + requestType;
-    }
-
-    public void greetMeOneWay(String requestType) {
-        System.out.println("*********  greetMeOneWay: " + requestType);        
-    }
-
-    public void pingMe() throws PingMeFault {
-        FaultDetail faultDetail = new FaultDetail();
-        faultDetail.setMajor((short)2);
-        faultDetail.setMinor((short)1);
-        throw new PingMeFault("PingMeFault raised by server", faultDetail);
-        
-    }
+public class GreeterImplDoc extends GreeterImplDocBase {
 
 }

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java?rev=679247&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java Wed
Jul 23 17:37:00 2008
@@ -0,0 +1,48 @@
+/**
+ * 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.cxf.systest.jms;
+
+import org.apache.hello_world_doc_lit.Greeter;
+import org.apache.hello_world_doc_lit.PingMeFault;
+import org.apache.hello_world_doc_lit.types.FaultDetail;
+
+public class GreeterImplDocBase implements Greeter {
+
+    public String sayHi() {
+        System.out.println("Call sayHi here ");
+        return "Bonjour";
+    }
+
+    public String greetMe(String requestType) {
+        System.out.println("Reached here :" + requestType);
+        return "Hello " + requestType;
+    }
+
+    public void greetMeOneWay(String requestType) {
+        System.out.println("*********  greetMeOneWay: " + requestType);        
+    }
+
+    public void pingMe() throws PingMeFault {
+        FaultDetail faultDetail = new FaultDetail();
+        faultDetail.setMajor((short)2);
+        faultDetail.setMinor((short)1);
+        throw new PingMeFault("PingMeFault raised by server", faultDetail);
+        
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java
Wed Jul 23 17:37:00 2008
@@ -18,21 +18,7 @@
  */
 package org.apache.cxf.systest.jms;
 
-import javax.annotation.Resource;
 import javax.jws.WebService;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.apache.cxf.hello_world_jms.BadRecordLitFault;
-import org.apache.cxf.hello_world_jms.HelloWorldPortType;
-import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
-import org.apache.cxf.hello_world_jms.types.BadRecordLit;
-import org.apache.cxf.hello_world_jms.types.ErrorCode;
-import org.apache.cxf.hello_world_jms.types.NoSuchCodeLit;
-import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
-import org.apache.cxf.transport.jms.JMSConstants;
-import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
 
 
 
@@ -41,57 +27,6 @@
             endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType",
             targetNamespace = "http://cxf.apache.org/hello_world_jms",
             wsdlLocation = "testutils/jms_test.wsdl")
-public class GreeterImplTwoWayJMS implements HelloWorldPortType {
-    @Resource
-    protected WebServiceContext wsContext;
-    public String greetMe(String me) {
-        MessageContext mc = wsContext.getMessageContext();
-        JMSMessageHeadersType headers =
-            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
-        System.out.println("get the message headers JMSCorrelationID" + headers.getJMSCorrelationID());
-        System.out.println("Reached here :" + me);
-        
-        // set reply header custom property
-        JMSPropertyType testProperty = new JMSPropertyType();
-        testProperty.setName("Test_Prop");
-        testProperty.setValue("some return value "  + me);
-        
-        System.out.println("found property in request headers at index: " 
-                           + headers.getProperty().indexOf(testProperty));
-        
-        JMSMessageHeadersType responseHeaders =
-            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(testProperty);
-        
-        return "Hello " + me;
-    }
-
-    public String sayHi() {        
-        return "Bonjour";
-    }
-    
-    public void greetMeOneWay(String requestType) {
-        System.out.println("*********  greetMeOneWay: " + requestType);
-    }
-    
-    public TestRpcLitFaultResponse testRpcLitFault(String faultType) 
-        throws BadRecordLitFault, NoSuchCodeLitFault {
-        BadRecordLit badRecord = new BadRecordLit();
-        badRecord.setReason("BadRecordLitFault");
-        if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
-            throw new BadRecordLitFault("TestBadRecordLit", badRecord);
-        }
-        if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
-            ErrorCode ec = new ErrorCode();
-            ec.setMajor((short)1);
-            ec.setMinor((short)1);
-            NoSuchCodeLit nscl = new NoSuchCodeLit();
-            nscl.setCode(ec);
-            throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
-        }
-        
-        return new TestRpcLitFaultResponse();
-    }
-    
+public class GreeterImplTwoWayJMS extends TwoWayJMSImplBase {    
     
 }

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java Wed
Jul 23 17:37:00 2008
@@ -128,6 +128,49 @@
     }
 
     @Test
+    public void docBasicJmsDestinationTest() throws Exception {
+        QName serviceName = getServiceName(new QName("http://apache.org/hello_world_doc_lit",

+                                 "SOAPService6"));
+        QName portName = getPortName(new QName("http://apache.org/hello_world_doc_lit", "SoapPort6"));
+        URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
+        assertNotNull(wsdl);
+
+        SOAPService2 service = new SOAPService2(wsdl, serviceName);
+        assertNotNull(service);
+
+        String response1 = new String("Hello Milestone-");
+        String response2 = new String("Bonjour");
+        try {
+            Greeter greeter = service.getPort(portName, Greeter.class);
+            for (int idx = 0; idx < 5; idx++) {
+
+                greeter.greetMeOneWay("test String");
+                
+                String greeting = greeter.greetMe("Milestone-" + idx);
+                assertNotNull("no response received from service", greeting);
+                String exResponse = response1 + idx;
+                assertEquals(exResponse, greeting);
+
+
+                
+                String reply = greeter.sayHi();
+                assertNotNull("no response received from service", reply);
+                assertEquals(response2, reply);
+                
+                try {
+                    greeter.pingMe();
+                    fail("Should have thrown FaultException");
+                } catch (PingMeFault ex) {
+                    assertNotNull(ex.getFaultInfo());
+                }                
+              
+            }
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+
+    @Test
     public void testBasicConnection() throws Exception {
         QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms",

                                  "HelloWorldService"));
@@ -200,7 +243,7 @@
             throw (Exception)ex.getCause();
         }
     }
-    
+
     @Test
     public void testOneWayTopicConnection() throws Exception {
         QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms",

@@ -225,6 +268,30 @@
         }
     }
     
+    @Test
+    public void testJmsDestTopicConnection() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms",

+                                 "JmsDestinationPubSubService"));
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                             "JmsDestinationPubSubPort"));
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldPubSubService service = new HelloWorldPubSubService(wsdl, serviceName);
+        assertNotNull(service);
+
+        try {
+            HelloWorldPubSubPort greeter = service.getPort(portName, HelloWorldPubSubPort.class);
+            for (int idx = 0; idx < 5; idx++) {
+                greeter.greetMeOneWay("JMS:PubSub:Milestone-" + idx);
+            }
+            //Give some time to complete one-way calls.
+            Thread.sleep(100L);
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
     @Test 
     public void testConnectionsWithinSpring() throws Exception {
         ClassPathXmlApplicationContext ctx = 

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java?rev=679247&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java Wed
Jul 23 17:37:00 2008
@@ -0,0 +1,40 @@
+/**
+ * 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.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
+
+
+@WebService(serviceName = "JmsDestinationPubSubService", 
+            portName = "JmsDestinationPubSubPort", 
+            endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPubSubPort",
+            targetNamespace = "http://cxf.apache.org/hello_world_jms",
+            wsdlLocation = "testutils/jms_test.wsdl")
+
+public class JmsDestPubSubImpl implements HelloWorldPubSubPort {
+
+    public void greetMeOneWay(String stringParam0) {
+        // TODO Auto-generated method stub
+        System.out.println("*********  greetMeOneWay: " + stringParam0);
+
+    }
+
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JmsDestPubSubImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/Server.java Wed Jul 23 17:37:00
2008
@@ -31,12 +31,17 @@
         Object impl3  = new GreeterImplTopicOneWay();
         Object impleDoc = new GreeterImplDoc();
         Object impl4 = new GreeterByteMessageImpl();
+        Object impl5 =  new SoapService6SoapPort6Impl();
+        Object impl6 = new JmsDestPubSubImpl();
+        
         Endpoint.publish(null, impleDoc);
         String address = "http://localhost:9000/SoapContext/SoapPort";
         Endpoint.publish(address, implementor);
         Endpoint.publish("http://testaddr.not.required/", impl2);
         Endpoint.publish("http://testaddr.not.required.topic/", impl3);
         Endpoint.publish("http://testaddr.not.required.byte/", impl4);
+        Endpoint.publish("http://testaddr.not.required.jms/", impl5);
+        Endpoint.publish("http://ignore", impl6);
     }
 
 

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java?rev=679247&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
(added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
Wed Jul 23 17:37:00 2008
@@ -0,0 +1,30 @@
+/**
+ * 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.cxf.systest.jms;
+
+import javax.jws.WebService;
+
+@WebService(serviceName = "SOAPService6", 
+            portName = "SoapPort6", 
+            endpointInterface = "org.apache.hello_world_doc_lit.Greeter",
+            targetNamespace = "http://apache.org/hello_world_doc_lit",
+            wsdlLocation = "testutils/hello_world_doc_lit.wsdl")
+public class SoapService6SoapPort6Impl extends GreeterImplDocBase {
+
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/SoapService6SoapPort6Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java?rev=679247&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java Wed
Jul 23 17:37:00 2008
@@ -0,0 +1,89 @@
+/**
+ * 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.cxf.systest.jms;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.apache.cxf.hello_world_jms.BadRecordLitFault;
+import org.apache.cxf.hello_world_jms.HelloWorldPortType;
+import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
+import org.apache.cxf.hello_world_jms.types.BadRecordLit;
+import org.apache.cxf.hello_world_jms.types.ErrorCode;
+import org.apache.cxf.hello_world_jms.types.NoSuchCodeLit;
+import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
+import org.apache.cxf.transport.jms.JMSConstants;
+import org.apache.cxf.transport.jms.JMSMessageHeadersType;
+import org.apache.cxf.transport.jms.JMSPropertyType;
+
+public class TwoWayJMSImplBase implements HelloWorldPortType {
+
+    @Resource
+    protected WebServiceContext wsContext;
+    public String greetMe(String me) {
+        MessageContext mc = wsContext.getMessageContext();
+        JMSMessageHeadersType headers =
+            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_REQUEST_HEADERS);
+        System.out.println("get the message headers JMSCorrelationID" + headers.getJMSCorrelationID());
+        System.out.println("Reached here :" + me);
+        
+        // set reply header custom property
+        JMSPropertyType testProperty = new JMSPropertyType();
+        testProperty.setName("Test_Prop");
+        testProperty.setValue("some return value "  + me);
+        
+        System.out.println("found property in request headers at index: " 
+                           + headers.getProperty().indexOf(testProperty));
+        
+        JMSMessageHeadersType responseHeaders =
+            (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
+        responseHeaders.getProperty().add(testProperty);
+        
+        return "Hello " + me;
+    }
+
+    public String sayHi() {        
+        return "Bonjour";
+    }
+    
+    public void greetMeOneWay(String requestType) {
+        System.out.println("*********  greetMeOneWay: " + requestType);
+    }
+    
+    public TestRpcLitFaultResponse testRpcLitFault(String faultType) 
+        throws BadRecordLitFault, NoSuchCodeLitFault {
+        BadRecordLit badRecord = new BadRecordLit();
+        badRecord.setReason("BadRecordLitFault");
+        if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
+            throw new BadRecordLitFault("TestBadRecordLit", badRecord);
+        }
+        if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
+            ErrorCode ec = new ErrorCode();
+            ec.setMajor((short)1);
+            ec.setMinor((short)1);
+            NoSuchCodeLit nscl = new NoSuchCodeLit();
+            nscl.setCode(ec);
+            throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
+        }
+        
+        return new TestRpcLitFaultResponse();
+    }
+
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl (original)
+++ cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl Wed Jul 23 17:37:00
2008
@@ -227,6 +227,17 @@
             <soap:address location="http://localhost:9002/SOAPService5/SoapPort5"/>
         </wsdl:port>
     </wsdl:service>
+    <wsdl:service name="SOAPService6">
+        <wsdl:port name="SoapPort6" binding="tns:Greeter_SOAPBinding">
+               <jms:address
+                   jndiConnectionFactoryName="ConnectionFactory"
+                   jmsDestinationName="dynamicQueues/routertest.SOAPService6Q.text"
+                   jmsReplyDestinationName="dynamicQueues/SoapService6.reply.queue">
+                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+               </jms:address>
+        </wsdl:port>
+    </wsdl:service>
 
     <!-- XML Binding based Services-->
     <wsdl:service name="XMLService1">

Modified: cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=679247&r1=679246&r2=679247&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl (original)
+++ cxf/trunk/testutils/src/main/resources/wsdl/jms_test.wsdl Wed Jul 23 17:37:00 2008
@@ -335,7 +335,7 @@
             <jms:server durableSubscriberName="CXF_subscriber"/>
         </port>
     </service>
-    
+        
     <service name="HelloWorldService">
            <port binding="tns:HelloWorldPortBinding" name="HelloWorldPort">
                <jms:address
@@ -378,6 +378,7 @@
             <jms:server durableSubscriberName="CXF_subscriber"/>
         </port>
     </service>
+
     <service name="HWByteMsgService">
         <port binding="tns:HelloWorldPortBinding" name="HWSByteMsgPort">
             <jms:address
@@ -432,7 +433,19 @@
             </jms:address>
         </port>
     </service>
-    
+
+    <service name="JmsDestinationPubSubService">
+        <port binding="tns:HelloWorldPubSubBinding" name="JmsDestinationPubSubPort">
+            <jms:address
+               destinationStyle="topic"
+               jndiConnectionFactoryName="ConnectionFactory" 
+               jmsDestinationName="dynamicTopics/test.jmstransport.oneway.topic.jmsdest">
+               <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+               <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+            </jms:address>
+        </port>
+    </service>
+        
     <service name="JMSSOAPServiceAddressing">
         <port binding="tns:HWJMSAddressingBinding" name="HWJMSAddressingPort">
             <jms:address



Mime
View raw message