hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [3/6] hbase git commit: HBASE-15975 logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong (Huaxiang Sun)
Date Thu, 09 Jun 2016 05:51:37 GMT
HBASE-15975 logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong (Huaxiang
Sun)


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

Branch: refs/heads/branch-1.3
Commit: ba9c11ef1f47f8b7bd1372b63fd9b6a3d868f466
Parents: 2bba03c
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Wed Jun 8 22:42:07 2016 -0700
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Wed Jun 8 22:45:26 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/TestHTableDescriptor.java       | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ba9c11ef/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
index 4d9caae..c09e41b 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
@@ -54,35 +54,36 @@ public class TestHTableDescriptor {
   public void testAddCoprocessorWithSpecStr() throws IOException {
     HTableDescriptor htd = new HTableDescriptor(TableName.META_TABLE_NAME);
     String cpName = "a.b.c.d";
-    boolean expected = false;
     try {
       htd.addCoprocessorWithSpec(cpName);
+      fail();
     } catch (IllegalArgumentException iae) {
-      expected = true;
+      // Expected as cpName is invalid
     }
-    if (!expected) fail();
+
     // Try minimal spec.
     try {
       htd.addCoprocessorWithSpec("file:///some/path" + "|" + cpName);
+      fail();
     } catch (IllegalArgumentException iae) {
-      expected = false;
+      // Expected to be invalid
     }
-    if (expected) fail();
+
     // Try more spec.
     String spec = "hdfs:///foo.jar|com.foo.FooRegionObserver|1001|arg1=1,arg2=2";
     try {
       htd.addCoprocessorWithSpec(spec);
     } catch (IllegalArgumentException iae) {
-      expected = false;
+      fail();
     }
-    if (expected) fail();
+
     // Try double add of same coprocessor
     try {
       htd.addCoprocessorWithSpec(spec);
+      fail();
     } catch (IOException ioe) {
-      expected = true;
+      // Expect that the coprocessor already exists
     }
-    if (!expected) fail();
   }
 
   @Test


Mime
View raw message