You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2017/03/27 11:32:22 UTC

[1/2] cxf git commit: [CXF-7301] Trying to catch the in exceptions with the status less than 300 (the higher-value status will generate an exception)

Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 4816a975b -> 3a14d3852


[CXF-7301] Trying to catch the in exceptions with the status less than 300 (the higher-value status will generate an exception)


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

Branch: refs/heads/3.1.x-fixes
Commit: 95fb948cb8b008791028c5c36db700722ca2e0d1
Parents: fd28dc9
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Mar 27 12:26:34 2017 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Mar 27 12:31:55 2017 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/client/AbstractClient.java    |  7 +++++--
 .../systest/jaxrs/security/xml/JAXRSXmlSecTest.java    | 13 +++----------
 2 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/95fb948c/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 8dfeb6e..30e032f 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -568,7 +568,9 @@ public abstract class AbstractClient implements Client {
                 }
             }
         }
-        ex = message.getContent(Exception.class);
+        if (ex == null) {
+            ex = message.getContent(Exception.class);
+        }
         if (ex != null
             || PropertyUtils.isTrue(exchange.get(SERVICE_NOT_AVAIL_PROPERTY))
                 && PropertyUtils.isTrue(exchange.get(COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY))) {
@@ -588,7 +590,8 @@ public abstract class AbstractClient implements Client {
         
         Exchange exchange = outMessage.getExchange();
         Integer responseCode = getResponseCode(exchange);
-        if (responseCode == null 
+        if (responseCode == null
+            || responseCode < 300 && !(actualEx instanceof IOException) 
             || actualEx instanceof IOException && exchange.get("client.redirect.exception") != null) {
             if (actualEx instanceof ProcessingException) {
                 throw (RuntimeException)actualEx;

http://git-wip-us.apache.org/repos/asf/cxf/blob/95fb948c/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
index f1b22c3..b1c42d8 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
@@ -45,6 +45,7 @@ import org.apache.cxf.systest.jaxrs.security.Book;
 import org.apache.cxf.systest.jaxrs.security.BookStore;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.xml.security.encryption.XMLCipher;
+
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -305,11 +306,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
         } catch (WebApplicationException ex) {
             fail(ex.getMessage());
         } catch (ProcessingException ex) {
-            if (ex.getCause() != null && ex.getCause().getMessage() != null) {
-                fail(ex.getCause().getMessage());
-            } else {
-                fail(ex.getMessage());
-            }
+            assertTrue(ex.getCause() instanceof BadRequestException);
         }
     }
     
@@ -519,11 +516,7 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
                 fail(ex.getMessage());
             }
         } catch (ProcessingException ex) {
-            if (ex.getCause() != null && ex.getCause().getMessage() != null) {
-                fail(ex.getCause().getMessage());
-            } else {
-                fail(ex.getMessage());
-            }
+            assertTrue(ex.getCause() instanceof BadRequestException);
         }
         
     }


[2/2] cxf git commit: Merge branch '3.1.x-fixes' of https://git-wip-us.apache.org/repos/asf/cxf into 3.1.x-fixes

Posted by se...@apache.org.
Merge branch '3.1.x-fixes' of https://git-wip-us.apache.org/repos/asf/cxf into 3.1.x-fixes


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

Branch: refs/heads/3.1.x-fixes
Commit: 3a14d385226d8af92b9998bd9258464abf313e15
Parents: 95fb948 4816a97
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Mar 27 12:32:04 2017 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Mar 27 12:32:04 2017 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/systest/jaxrs/BookStore.java |  7 ++
 .../org/apache/cxf/systest/jaxrs/XXETest.java   | 54 ++++++++++++++
 .../jaxrs/src/test/resources/logging.properties | 74 ++++++++++++++++++++
 3 files changed, 135 insertions(+)
----------------------------------------------------------------------