Author: veithen
Date: Sun Oct 16 22:27:11 2016
New Revision: 1765194

URL: http://svn.apache.org/viewvc?rev=1765194&view=rev
Log:
AXIS2-5809: Merge r1765193 to the 1.7 branch.

Modified:
    axis/axis2/java/core/branches/1_7/   (props changed)
    
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/EchoServiceImpl.java
    
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/ServiceTest.java
    
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/
   (props changed)
    
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPClient4TransportSender.java

Propchange: axis/axis2/java/core/branches/1_7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 16 22:27:11 2016
@@ -1,4 +1,4 @@
 /axis/axis2/java/core/branches/1_6:1295540
 /axis/axis2/java/core/branches/AXIOM-420:1334386-1336397
 
/axis/axis2/java/core/branches/AXIS2-4318:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188
+/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188,1765193

Modified: 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/EchoServiceImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/EchoServiceImpl.java?rev=1765194&r1=1765193&r2=1765194&view=diff
==============================================================================
--- 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/EchoServiceImpl.java
 (original)
+++ 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/EchoServiceImpl.java
 Sun Oct 16 22:27:11 2016
@@ -21,6 +21,10 @@ package org.apache.axis2.databinding.axi
 public class EchoServiceImpl extends EchoServiceSkeleton {
     @Override
     public EchoResponse echo(Echo echo) {
+        String content = echo.getContent();
+        if (content.isEmpty()) {
+            throw new RuntimeException();
+        }
         EchoResponse response = new EchoResponse();
         response.setContent(echo.getContent());
         return response;

Modified: 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/ServiceTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/ServiceTest.java?rev=1765194&r1=1765193&r2=1765194&view=diff
==============================================================================
--- 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/ServiceTest.java
 (original)
+++ 
axis/axis2/java/core/branches/1_7/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5809/ServiceTest.java
 Sun Oct 16 22:27:11 2016
@@ -19,19 +19,19 @@
 package org.apache.axis2.databinding.axis2_5809;
 
 import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.fail;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.testutils.Axis2Server;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class ServiceTest {
     @ClassRule
     public static Axis2Server server = new 
Axis2Server("target/repo/AXIS2-5809");
     
-    @Ignore
     @Test
-    public void test() throws Exception {
+    public void testWithNormalResponse() throws Exception {
         EchoServiceStub stub = new 
EchoServiceStub(server.getConfigurationContext(), 
server.getEndpoint("EchoService"));
         for (int i=0; i<500; i++) {
             Echo request = new Echo();
@@ -39,4 +39,19 @@ public class ServiceTest {
             assertThat(stub.echo(request).getContent()).isEqualTo("test");
         }
     }
+    
+    @Test
+    public void testWithFault() throws Exception {
+        EchoServiceStub stub = new 
EchoServiceStub(server.getConfigurationContext(), 
server.getEndpoint("EchoService"));
+        for (int i=0; i<500; i++) {
+            Echo request = new Echo();
+            request.setContent("");
+            try {
+                stub.echo(request);
+                fail("Expected AxisFault");
+            } catch (AxisFault ex) {
+                // Expected
+            }
+        }
+    }
 }

Propchange: 
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct 16 22:27:11 2016
@@ -1,4 +1,4 @@
 
/axis/axis2/java/core/branches/1_6/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4:1295540
 
/axis/axis2/java/core/branches/AXIOM-420/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4:1334386-1336397
 
/axis/axis2/java/core/branches/AXIS2-4318/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739815,1739826,1740693-1740694,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1745982
+/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739815,1739826,1740693-1740694,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1745982,1765193

Modified: 
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPClient4TransportSender.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPClient4TransportSender.java?rev=1765194&r1=1765193&r2=1765194&view=diff
==============================================================================
--- 
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPClient4TransportSender.java
 (original)
+++ 
axis/axis2/java/core/branches/1_7/modules/transport/http/src/org/apache/axis2/transport/http/impl/httpclient4/HTTPClient4TransportSender.java
 Sun Oct 16 22:27:11 2016
@@ -19,9 +19,13 @@
 
 package org.apache.axis2.transport.http.impl.httpclient4;
 
+import java.io.IOException;
+import java.io.InputStream;
+
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.transport.http.AbstractHTTPSender;
 import org.apache.axis2.transport.http.CommonsHTTPTransportSender;
 import org.apache.axis2.transport.http.HTTPConstants;
@@ -40,10 +44,20 @@ public class HTTPClient4TransportSender
 
     @Override
     public void cleanup(MessageContext msgContext) throws AxisFault {
-        // We don't need to call cleanup here because httpclient4 releases
-        // the connection and cleanup automatically
-        // TODO : Don't do this if we're not on the right thread! Can we 
confirm?
         log.trace("cleanup() releasing connection");
+        
+        OperationContext opContext = msgContext.getOperationContext();
+        if (opContext != null) {
+            InputStream in = 
(InputStream)opContext.getProperty(MessageContext.TRANSPORT_IN);
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException ex) {
+                    // Ignore
+                }
+            }
+        }
+        
         // guard against multiple calls
         msgContext.removeProperty(HTTPConstants.HTTP_METHOD);
 


Reply via email to