cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [3/7] git commit: [CXF-5539, CXF-5434] For JMS, don't create a back channel conduit if it's not needed.
Date Mon, 05 May 2014 19:58:53 GMT
[CXF-5539, CXF-5434] For JMS, don't create a back channel conduit if it's not needed.

Conflicts:
	rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
	systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4bdaa8bb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4bdaa8bb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4bdaa8bb

Branch: refs/heads/2.6.x-fixes
Commit: 4bdaa8bbd05872986c65237df20de9967831410a
Parents: 8d05228
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon May 5 14:47:48 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon May 5 15:57:37 2014 -0400

----------------------------------------------------------------------
 .../cxf/transport/jms/JMSDestination.java       |  7 +++++
 .../cxf/systest/jms/GreeterImplSoap12.java      |  5 ++++
 .../systest/jms/JMSClientServerSoap12Test.java  | 31 ++++++++++++++++++++
 3 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4bdaa8bb/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
index b6ce449..8ffdc6e 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
@@ -105,6 +105,13 @@ public class JMSDestination extends AbstractMultiplexDestination
      * @return the inbuilt backchannel
      */
     protected Conduit getInbuiltBackChannel(Message inMessage) {
+        //with JMS, non-robust OneWays will never need to send back a response, even a "202"
response.
+        boolean robust =
+        MessageUtils.isTrue(inMessage.getContextualProperty(Message.ROBUST_ONEWAY));
+        if (inMessage.getExchange().isOneWay()
+            && !robust) {
+            return null;
+        }
         EndpointReferenceType anon = EndpointReferenceUtils.getAnonymousEndpointReference();
         return new BackChannelConduit(this, anon, inMessage);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4bdaa8bb/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
index f163059..b91a63a 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
@@ -19,6 +19,9 @@
 package org.apache.cxf.systest.jms;
 
 import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
+
+import org.apache.cxf.annotations.Logging;
 
 
 @WebService(serviceName = "SOAPService8", 
@@ -26,6 +29,8 @@ import javax.jws.WebService;
             endpointInterface = "org.apache.hello_world_doc_lit.Greeter",
             targetNamespace = "http://apache.org/hello_world_doc_lit",
             wsdlLocation = "testutils/hello_world_doc_lit.wsdl")
+@Addressing(required = false)
+@Logging
 public class GreeterImplSoap12 extends GreeterImplDocBase {
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4bdaa8bb/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
index 95c16a7..00d54f4 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
@@ -24,6 +24,7 @@ import java.net.URL;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.Endpoint;
+import javax.xml.ws.soap.AddressingFeature;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -40,6 +41,7 @@ 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.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -144,4 +146,33 @@ public class JMSClientServerSoap12Test extends AbstractBusClientServerTestBase
{
         }
         bus.shutdown(true);
     }
+    @Test
+    public void testWSAddressingWithJms() throws Exception {
+        QName serviceName = new QName("http://apache.org/hello_world_doc_lit", 
+                                 "SOAPService8");
+        QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort8");
+        URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
+        SOAPService2 service = new SOAPService2(wsdl, serviceName);
+        Greeter greeter = markForClose(service.getPort(portName, Greeter.class, 
+                                                       cff, new AddressingFeature()));
+
+        for (int idx = 0; idx < 5; idx++) {
+
+            greeter.greetMeOneWay("test String");
+
+            String greeting = greeter.greetMe("Milestone-" + idx);
+            Assert.assertEquals(new String("Hello Milestone-") + idx, greeting);
+
+            String reply = greeter.sayHi();
+            Assert.assertEquals("Bonjour", reply);
+
+            try {
+                greeter.pingMe();
+                Assert.fail("Should have thrown FaultException");
+            } catch (PingMeFault ex) {
+                Assert.assertNotNull(ex.getFaultInfo());
+            }
+
+        }
+    }
 }


Mime
View raw message