cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r792288 - in /cxf/branches/2.2.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/main/resources/schemas/wsdl/ systests/src/test/java/org/apache/cxf/systest/jms/ testutils/src/main/resources/wsdl/
Date Wed, 08 Jul 2009 20:16:36 GMT
Author: dkulp
Date: Wed Jul  8 20:16:35 2009
New Revision: 792288

URL: http://svn.apache.org/viewvc?rev=792288&view=rev
Log:
Merged revisions 792262 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r792262 | dkulp | 2009-07-08 15:01:58 -0400 (Wed, 08 Jul 2009) | 3 lines
  
  [CXF-2316] Support for replyTo header even on one-ways (a bit against
  spec, but some older servers expect it).   Patch from Marat Bedretdinov
  applied.
........

Added:
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java
      - copied unchanged from r792262, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java
      - copied unchanged from r792262, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
    cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul  8 20:16:35 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644,790868,791301,791354,791538,791753,791947,792007,792096,792183,792261-792262

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Wed Jul  8 20:16:35 2009
@@ -32,6 +32,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.MessageListener;
 import javax.jms.Session;
@@ -112,7 +113,7 @@
         if (outMessage == null) {
             throw new RuntimeException("Exchange to be sent has no outMessage");
         }
-
+        
         boolean isTextPayload = JMSConstants.TEXT_MESSAGE_TYPE.equals(jmsConfig.getMessageType());
         if (isTextPayload && MessageUtils.isTrue(outMessage.getContextualProperty(
             org.apache.cxf.message.Message.MTOM_ENABLED)) 
@@ -122,10 +123,10 @@
             throw new ConfigurationException(msg);
         }
         
-        JMSMessageHeadersType headers = (JMSMessageHeadersType)outMessage
+        final JMSMessageHeadersType headers = (JMSMessageHeadersType)outMessage
             .get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
 
-        JmsTemplate jmsTemplate = JMSFactory.createJmsTemplate(jmsConfig, headers);
+        final JmsTemplate jmsTemplate = JMSFactory.createJmsTemplate(jmsConfig, headers);
         String userCID = headers != null ? headers.getJMSCorrelationID() : null;
         DefaultMessageListenerContainer jmsList = jmsListener;
         if (!exchange.isOneWay()) {
@@ -162,8 +163,19 @@
             public javax.jms.Message createMessage(Session session) throws JMSException {
                 String messageType = jmsConfig.getMessageType();
                 final javax.jms.Message jmsMessage;
-                jmsMessage = JMSUtils.buildJMSMessageFromCXFMessage(outMessage, request,
messageType,
-                                                                    session, replyTo,
+                Destination replyToDestination = replyTo;
+                if (exchange.isOneWay() && !jmsConfig.isEnforceSpec()) {
+                    final String contextReplyToName = 
+                        (headers != null) ? headers.getJMSReplyTo() : null;
+                    if (contextReplyToName != null) {
+                        replyToDestination = 
+                            JMSFactory.resolveOrCreateDestination(jmsTemplate, 
+                                                                  contextReplyToName, 
+                                                                  jmsConfig.isPubSubDomain());
+                    }
+                }
+                jmsMessage = JMSUtils.buildJMSMessageFromCXFMessage(outMessage, request,
+                                                                    messageType, session,
replyToDestination,
                                                                     correlationId);
                 LOG.log(Level.FINE, "client sending request: ", jmsMessage);
                 return jmsMessage;

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Wed Jul  8 20:16:35 2009
@@ -80,6 +80,7 @@
     private long recoveryInterval = DEFAULT_VALUE;
     private int cacheLevel = DEFAULT_VALUE;
     private String cacheLevelName;
+    private boolean enforceSpec = true;
     
     private ConnectionFactory wrappedConnectionFactory;
     
@@ -437,4 +438,11 @@
         this.durableSubscriptionClientId = durableSubscriptionClientId;
     }
 
+    public boolean isEnforceSpec() {
+        return enforceSpec;
+    }
+
+    public void setEnforceSpec(boolean enforceSpec) {
+        this.enforceSpec = enforceSpec;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Wed Jul  8 20:16:35 2009
@@ -193,7 +193,7 @@
      * @param pubSubDomain true=pubSub, false=Queues
      * @return resolved destination
      */
-    private static Destination resolveOrCreateDestination(final JmsTemplate jmsTemplate,
+    protected static Destination resolveOrCreateDestination(final JmsTemplate jmsTemplate,
                                                           final String replyToDestinationName,
                                                           final boolean pubSubDomain) {
         return (Destination)jmsTemplate.execute(new SessionCallback() {

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
Wed Jul  8 20:16:35 2009
@@ -104,6 +104,7 @@
             if (clientConfig.isSetConduitSelectorPrefix()) {
                 jmsConfig.setConduitSelectorPrefix(clientConfig.getConduitSelectorPrefix());
             }
+            jmsConfig.setEnforceSpec(clientConfig.isEnforceSpec());
             jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());
      
             jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
             jmsConfig.setDurableSubscriptionClientId(serverConfig.getDurableSubscriptionClientId());

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
Wed Jul  8 20:16:35 2009
@@ -35,7 +35,9 @@
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
+import javax.jms.Queue;
 import javax.jms.Session;
+import javax.jms.Topic;
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
@@ -150,6 +152,15 @@
             headers.setJMSTimeStamp(new Long(message.getJMSTimestamp()));
             headers.setJMSType(message.getJMSType());
 
+            if (message.getJMSReplyTo() != null) {
+                Destination replyTo = message.getJMSReplyTo();
+                if (replyTo instanceof Queue) {
+                    headers.setJMSReplyTo(((Queue)replyTo).getQueueName());
+                } else if (replyTo instanceof Topic) {
+                    headers.setJMSReplyTo(((Topic)replyTo).getTopicName());
+                }
+            }
+
             Map<String, List<String>> protHeaders = new HashMap<String, List<String>>();
             List<JMSPropertyType> props = headers.getProperty();
             Enumeration enm = message.getPropertyNames();

Modified: cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jms/src/main/resources/schemas/wsdl/jms.xsd Wed
Jul  8 20:16:35 2009
@@ -56,6 +56,7 @@
     				default="0" />
                 <xs:attribute name="conduitSelectorPrefix" type="xs:string" use="optional"
default=""/>    				
                 <xs:attribute name="useConduitIdSelector" type="xs:boolean" use="optional"/>
+                <xs:attribute name="enforceSpec" type="xs:boolean" use="optional" default="true"/>
     		</xs:extension>
     	</xs:complexContent>
     </xs:complexType>
@@ -89,6 +90,7 @@
         <xs:attribute name="JMSMessageID" type="xs:string"/>
         <xs:attribute name="JMSPriority" type="xs:int"/>
         <xs:attribute name="JMSRedelivered" type="xs:boolean"/>
+        <xs:attribute name="JMSReplyTo" type="xs:string"/>
         <xs:attribute name="JMSTimeStamp" type="xs:long"/>
         <xs:attribute name="JMSType" type="xs:string"/>
         <xs:attribute name="TimeToLive" type="xs:long"/>

Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
Wed Jul  8 20:16:35 2009
@@ -32,10 +32,13 @@
 import javax.xml.namespace.QName;
 import javax.xml.ws.Binding;
 import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Endpoint;
 import javax.xml.ws.Holder;
 import javax.xml.ws.soap.SOAPBinding;
 
 
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.hello_world_jms.BadRecordLitFault;
 import org.apache.cxf.hello_world_jms.HWByteMsgService;
 import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort;
@@ -43,6 +46,7 @@
 import org.apache.cxf.hello_world_jms.HelloWorldPortType;
 import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
 import org.apache.cxf.hello_world_jms.HelloWorldPubSubService;
+import org.apache.cxf.hello_world_jms.HelloWorldQueueDecoupledOneWaysService;
 import org.apache.cxf.hello_world_jms.HelloWorldService;
 import org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationIDNoPrefix;
 import org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationIDStaticPrefix;
@@ -51,27 +55,26 @@
 import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
 import org.apache.cxf.jms_mtom.JMSMTOMPortType;
 import org.apache.cxf.jms_mtom.JMSMTOMService;
+import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.transport.jms.AddressType;
+import org.apache.cxf.transport.jms.JMSConduit;
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
+import org.apache.cxf.transport.jms.JMSNamingPropertyType;
 import org.apache.cxf.transport.jms.JMSPropertyType;
 import org.apache.hello_world_doc_lit.Greeter;
 import org.apache.hello_world_doc_lit.PingMeFault;
 import org.apache.hello_world_doc_lit.SOAPService2;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class JMSClientServerTest extends AbstractBusClientServerTestBase {
     
-    protected static boolean serversStarted;
-
-    @Before
-    public void startServers() throws Exception {
-        if (serversStarted) {
-            return;
-        }
+    @BeforeClass
+    public static void startServers() throws Exception {
         Map<String, String> props = new HashMap<String, String>();          
     
         if (System.getProperty("activemq.store.dir") != null) {
             props.put("activemq.store.dir", System.getProperty("activemq.store.dir"));
@@ -84,7 +87,6 @@
 
         assertTrue("server did not launch correctly", 
                    launchServer(Server.class, false));
-        serversStarted = true;
     }
     
     public URL getWSDLURL(String s) throws Exception {
@@ -112,6 +114,17 @@
         String response2 = new String("Bonjour");
         try {
             Greeter greeter = service.getPort(portName, Greeter.class);
+            Client client = ClientProxy.getClient(greeter);
+            EndpointInfo ei = client.getEndpoint().getEndpointInfo();
+            AddressType address = ei.getTraversedExtensor(new AddressType(), AddressType.class);
+            JMSNamingPropertyType name = new JMSNamingPropertyType();
+            JMSNamingPropertyType password = new JMSNamingPropertyType();
+            name.setName("java.naming.security.principal");
+            name.setValue("ivan");
+            password.setName("java.naming.security.credentials");
+            password.setValue("the-terrible");
+            address.getJMSNamingProperty().add(name);
+            address.getJMSNamingProperty().add(password);
             for (int idx = 0; idx < 5; idx++) {
 
                 greeter.greetMeOneWay("test String");
@@ -225,6 +238,8 @@
             }
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();
+        } catch (Exception t) {
+            throw t;
         }
     }
     
@@ -275,7 +290,7 @@
                 greeter.greetMeOneWay("JMS:PubSub:Milestone-" + idx);
             }
             //Give some time to complete one-way calls.
-            Thread.sleep(100L);
+            Thread.sleep(50L);
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();
         }
@@ -299,7 +314,7 @@
                 greeter.greetMeOneWay("JMS:PubSub:Milestone-" + idx);
             }
             //Give some time to complete one-way calls.
-            Thread.sleep(100L);
+            Thread.sleep(50L);
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();
         }
@@ -381,6 +396,131 @@
         }
     }
 
+    @Test
+    public void testQueueDecoupledOneWaysConnection() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms",

+                                                     "HelloWorldQueueDecoupledOneWaysService"));
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldQueueDecoupledOneWaysPort"));
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldQueueDecoupledOneWaysService service = 
+            new HelloWorldQueueDecoupledOneWaysService(wsdl, serviceName);
+        assertNotNull(service);
+        Endpoint requestEndpoint = null;
+        Endpoint replyEndpoint = null;
+        try {
+            HelloWorldOneWayPort greeter = service.getPort(portName, HelloWorldOneWayPort.class);
+            GreeterImplQueueDecoupledOneWays requestServant = new GreeterImplQueueDecoupledOneWays();
+            requestEndpoint = Endpoint.publish("", requestServant);
+            GreeterImplQueueDecoupledOneWaysDeferredReply replyServant = 
+                new GreeterImplQueueDecoupledOneWaysDeferredReply();
+            replyEndpoint = Endpoint.publish("", replyServant);
+            
+            InvocationHandler handler  = Proxy.getInvocationHandler(greeter);
+            BindingProvider  bp = (BindingProvider)handler;
+            Map<String, Object> requestContext = bp.getRequestContext();
+            JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
+            requestHeader.setJMSReplyTo("dynamicQueues/test.jmstransport.oneway.with.set.replyto.reply");
+            requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
+            String expectedRequest = "JMS:Queue:Request"; 
+            greeter.greetMeOneWay(expectedRequest);
+            String request = requestServant.ackRequestReceived(5000);
+            if (request == null) {
+                if (requestServant.getException() != null) {
+                    fail(requestServant.getException().getMessage());
+                } else {
+                    fail("The oneway call didn't reach its intended endpoint");
+                }
+            }
+            assertEquals(expectedRequest, request);
+            requestServant.proceedWithReply();
+            String expectedReply = requestServant.ackReplySent(5000);
+            if (expectedReply == null) {
+                if (requestServant.getException() != null) {
+                    fail(requestServant.getException().getMessage());
+                } else {
+                    fail("The decoupled one-way reply was not sent");
+                }
+            }
+            String reply = replyServant.ackRequest(5000);
+            if (reply == null) {
+                if (replyServant.getException() != null) {
+                    fail(replyServant.getException().getMessage());
+                } else {
+                    fail("The decoupled one-way reply didn't reach its intended endpoint");
+                }
+            }
+            assertEquals(expectedReply, reply);
+        } catch (Exception ex) {
+            throw ex;
+        } finally {
+            if (requestEndpoint != null) {
+                requestEndpoint.stop();
+            }
+            if (replyEndpoint != null) {
+                replyEndpoint.stop();
+            }
+        }
+    }
+    
+    @Test
+    public void testQueueOneWaySpecCompliantConnection() throws Exception {
+        QName serviceName = getServiceName(new QName("http://cxf.apache.org/hello_world_jms",

+                                                     "HelloWorldQueueDecoupledOneWaysService"));
+        QName portName = getPortName(new QName("http://cxf.apache.org/hello_world_jms", 
+                                               "HelloWorldQueueDecoupledOneWaysPort"));
+        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
+        assertNotNull(wsdl);
+
+        HelloWorldQueueDecoupledOneWaysService service = 
+            new HelloWorldQueueDecoupledOneWaysService(wsdl, serviceName);
+        assertNotNull(service);
+        Endpoint requestEndpoint = null;
+        try {
+            HelloWorldOneWayPort greeter = service.getPort(portName, HelloWorldOneWayPort.class);
+            GreeterImplQueueDecoupledOneWays requestServant = new GreeterImplQueueDecoupledOneWays(true);
+            requestEndpoint = Endpoint.publish("", requestServant);
+            
+            Client client = ClientProxy.getClient(greeter);
+            ((JMSConduit)client.getConduit()).getJmsConfig().setEnforceSpec(true);
+            InvocationHandler handler  = Proxy.getInvocationHandler(greeter);
+            BindingProvider  bp = (BindingProvider)handler;
+            Map<String, Object> requestContext = bp.getRequestContext();
+            JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
+            requestHeader.setJMSReplyTo("dynamicQueues/test.jmstransport.oneway.with.set.replyto.reply");
+            requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
+            String expectedRequest = "JMS:Queue:Request"; 
+            greeter.greetMeOneWay(expectedRequest);
+            String request = requestServant.ackRequestReceived(5000);
+            if (request == null) {
+                if (requestServant.getException() != null) {
+                    fail(requestServant.getException().getMessage());
+                } else {
+                    fail("The oneway call didn't reach its intended endpoint");
+                }
+            }
+            assertEquals(expectedRequest, request);
+            requestServant.proceedWithReply();
+            boolean ack = requestServant.ackNoReplySent(5000);
+            if (!ack) {
+                if (requestServant.getException() != null) {
+                    fail(requestServant.getException().getMessage());
+                } else {
+                    fail("The decoupled one-way reply was sent");
+                }
+            }
+        } catch (Exception ex) {
+            throw ex;
+        } finally {
+            if (requestEndpoint != null) {
+                requestEndpoint.stop();
+            }
+        }
+
+    }
+
     private static interface CorrelationIDFactory {
         String createCorrealtionID();
     }
@@ -527,7 +667,7 @@
         
         HelloWorldPortType port = service.getPort(portName, HelloWorldPortType.class);
         
-        for (int i = 0; i < 100; ++i) {
+        for (int i = 0; i < 10; ++i) {
             ClientRunnable client =  
                 new ClientRunnable(port,
                     new CorrelationIDFactory() {
@@ -609,7 +749,7 @@
         HelloWorldPortType portEng = service.getPort(portNameEng, HelloWorldPortType.class);
         HelloWorldPortType portSales = service.getPort(portNameSales, HelloWorldPortType.class);
         
-        for (int i = 0; i < 100; ++i) {
+        for (int i = 0; i < 10; ++i) {
             ClientRunnable client =  new ClientRunnable(portEng, "com.mycompany.eng:");
             Thread thread = new Thread(client);
             threads.add(thread);
@@ -654,7 +794,7 @@
         
         HelloWorldPortType port = service.getPort(portName, HelloWorldPortType.class);
         
-        for (int i = 0; i < 100; ++i) {
+        for (int i = 0; i < 10; ++i) {
             ClientRunnable client =  
                 new ClientRunnable(port);
             

Modified: cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl?rev=792288&r1=792287&r2=792288&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl (original)
+++ cxf/branches/2.2.x-fixes/testutils/src/main/resources/wsdl/jms_test.wsdl Wed Jul  8 20:16:35
2009
@@ -504,6 +504,27 @@
         </port>
     </service>
     
+    <service name="HelloWorldQueueDecoupledOneWaysService">
+        <port binding="tns:HelloWorldOneWayBinding" name="HelloWorldQueueDecoupledOneWaysPort">
+            <jms:address
+               jndiConnectionFactoryName="ConnectionFactory" 
+               jndiDestinationName="dynamicQueues/test.jmstransport.oneway.with.set.replyto">
+               <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>
+            <jms:clientConfig enforceSpec="false"/>
+        </port>
+        <port binding="tns:HelloWorldOneWayBinding" name="HelloWorldQueueDecoupledOneWaysReplyPort">
+            <jms:address
+               jndiConnectionFactoryName="ConnectionFactory" 
+               jndiDestinationName="dynamicQueues/test.jmstransport.oneway.with.set.replyto.reply">
+               <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="HelloWorldPubSubService">
         <port binding="tns:HelloWorldPubSubBinding" name="HelloWorldPubSubPort">
             <jms:address



Mime
View raw message