cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6252] Adding one more test
Date Wed, 11 Feb 2015 10:01:16 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 1d07267bc -> 52598eb9b


[CXF-6252] Adding one more test


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

Branch: refs/heads/master
Commit: 52598eb9b31ea7dfc7b4b87048e4ded459fbeb87
Parents: 1d07267
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Feb 11 10:00:58 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Feb 11 10:00:58 2015 +0000

----------------------------------------------------------------------
 .../cxf/systest/jaxrs/JAXRSAsyncClientTest.java | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/52598eb9/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
index fe9a81b..b3ae13c 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
@@ -33,12 +33,15 @@ import java.util.concurrent.Future;
 import javax.ws.rs.NotFoundException;
 import javax.ws.rs.ProcessingException;
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.client.ClientResponseContext;
 import javax.ws.rs.client.ClientResponseFilter;
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
@@ -146,6 +149,24 @@ public class JAXRSAsyncClientTest extends AbstractBusClientServerTestBase
{
             wc.close();
         }
     }
+    @Test
+    public void testNonExistentJaxrs20() throws Exception {
+        String address = "http://localhost/bookstore";
+        Client c = ClientBuilder.newClient();
+        c.register(new TestResponseFilter());
+        WebTarget t1 = c.target(address);
+        Future<Response> future = t1.request().async().get();
+        try {
+            future.get();
+            fail("Exception expected");
+        } catch (ExecutionException ex) {
+            Throwable cause = ex.getCause();
+            assertTrue(cause instanceof ProcessingException);
+            assertTrue(ex.getCause().getCause() instanceof ConnectException);
+        } finally {
+            c.close();
+        }
+    }
     
     @Test
     public void testPostBookProcessingException() throws Exception {


Mime
View raw message