You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sy...@apache.org on 2016/06/11 04:56:30 UTC

[44/50] hbase git commit: HBASE-15975 logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong (Huaxiang Sun)

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/41cc2155
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/41cc2155
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/41cc2155

Branch: refs/heads/hbase-12439
Commit: 41cc215544deb5f1f6cf522efd19229da0c99dd2
Parents: 031b745
Author: Matteo Bertozzi <ma...@cloudera.com>
Authored: Wed Jun 8 22:42:07 2016 -0700
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Wed Jun 8 22:42:50 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/41cc2155/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 680f2c1..70380e6 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
@@ -55,35 +55,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