cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cxf git commit: [CXF-7357] Testcase for UnknownHostException
Date Wed, 05 Jul 2017 13:54:19 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0287f7d3a -> cb607e912


[CXF-7357] Testcase for UnknownHostException


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

Branch: refs/heads/master
Commit: cb607e91281aaf822bb6a92fc34077435921a664
Parents: 0287f7d
Author: Dennis Kieselhorst <deki@apache.org>
Authored: Wed Jul 5 15:54:05 2017 +0200
Committer: Dennis Kieselhorst <deki@apache.org>
Committed: Wed Jul 5 15:54:05 2017 +0200

----------------------------------------------------------------------
 .../systest/jaxrs/JAXRS20ClientServerBookTest.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cb607e91/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
index d3b63af..583603c 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.net.URI;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -62,6 +63,7 @@ import javax.xml.ws.Holder;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
 
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
@@ -72,6 +74,7 @@ import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRS20ClientServerBookTest extends AbstractBusClientServerTestBase {
@@ -790,6 +793,19 @@ public class JAXRS20ClientServerBookTest extends AbstractBusClientServerTestBase
         assertEquals("CXF Rocks", b22.getName());
     }
 
+    @Ignore("CXF-7357")
+    @Test
+    public void testUnknownHostException() throws InterruptedException {
+        String address = "http://unknown-host/bookstore/bookheaders/simple/async";
+        try {
+            doTestPostBookAsyncHandler(address);
+            fail("Should fail with UnknownHostException");
+        } catch (ExecutionException e) {
+            assertTrue("Should fail with UnknownHostException",
+                    ExceptionUtils.getRootCause(e) instanceof UnknownHostException);
+        }
+    }
+
     private static class ReplaceBodyFilter implements ClientRequestFilter {
 
         @Override


Mime
View raw message