kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject [1/3] incubator-kudu git commit: [java client] Redo how we manage exceptions
Date Thu, 21 Jul 2016 22:40:14 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 83d692304 -> b57b02b94


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/0a792366/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java b/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
index 4393505..3e78918 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestTimeouts.java
@@ -16,9 +16,9 @@
 // under the License.
 package org.kududb.client;
 
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import com.google.common.collect.ImmutableList;
 import com.stumbleupon.async.TimeoutException;
 import org.junit.Test;
 
@@ -41,7 +41,7 @@ public class TestTimeouts extends BaseKuduTest {
     try {
       lowTimeoutsClient.listTabletServers();
       fail("Should have timed out");
-    } catch (TimeoutException ex) {
+    } catch (KuduException ex) {
       // Expected.
     }
 
@@ -53,20 +53,16 @@ public class TestTimeouts extends BaseKuduTest {
     try {
       lowTimeoutSession.apply(createBasicSchemaInsert(table, 1));
       fail("Should have timed out");
-    } catch (TimeoutException ex) { // If we timeout on the Deferred
-      // Expected.
-    } catch (NonRecoverableException ex) { // If we timeout when doing an internal deadline
check
-    // Expected.
+    } catch (KuduException ex) {
+      assertTrue(ex.getStatus().isTimedOut());
     }
 
     KuduScanner lowTimeoutScanner = lowTimeoutsClient.newScannerBuilder(table).build();
     try {
       lowTimeoutScanner.nextRows();
       fail("Should have timed out");
-    } catch (TimeoutException ex) {
-      // Expected.
-    } catch (NonRecoverableException ex) {
-      // Expected.
+    } catch (KuduException ex) {
+      assertTrue(ex.getStatus().isTimedOut());
     }
   }
 }


Mime
View raw message