cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1500735 - /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
Date Mon, 08 Jul 2013 13:56:37 GMT
Author: sergeyb
Date: Mon Jul  8 13:56:37 2013
New Revision: 1500735

URL: http://svn.apache.org/r1500735
Log:
[CXF-5026] Updating JAXRSAsyncClientTest to minimize a noise

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java?rev=1500735&r1=1500734&r2=1500735&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java
Mon Jul  8 13:56:37 2013
@@ -137,13 +137,14 @@ public class JAXRSAsyncClientTest extend
     public void testGetBookAsync404Callback() throws Exception {
         String address = "http://localhost:" + PORT + "/bookstore/bookheaders/404";
         WebClient wc = createWebClient(address);
-        final Holder<Book> holder = new Holder<Book>();
-        InvocationCallback<Book> callback = createCallback(holder);
+        final Holder<Object> holder = new Holder<Object>();
+        InvocationCallback<Object> callback = createCallback(holder);
         try {
             wc.async().get(callback).get();
             fail("Exception expected");
         } catch (ExecutionException ex) {
             assertTrue(ex.getCause() instanceof NotFoundException);
+            assertTrue(ex.getCause() == holder.value);
         }
     }
     
@@ -155,13 +156,13 @@ public class JAXRSAsyncClientTest extend
         return wc;
     }
     
-    private InvocationCallback<Book> createCallback(final Holder<Book> holder)
{
-        return new InvocationCallback<Book>() {
-            public void completed(Book response) {
+    private InvocationCallback<Object> createCallback(final Holder<Object> holder)
{
+        return new InvocationCallback<Object>() {
+            public void completed(Object response) {
                 holder.value = response;
             }
             public void failed(Throwable error) {
-                error.printStackTrace();
+                holder.value = error;
             }
         };
     }



Mime
View raw message