Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-15975

logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.2.2, 1.1.6, 0.98.21, 2.0.0
    • Component/s: test
    • Labels:
      None

      Description

      While working on an unitest case for HBASE-14644, crossed over
      testAddCoprocessorWithSpecStr().

         HTableDescriptor htd = new HTableDescriptor(TableName.META_TABLE_NAME);
          String cpName = "a.b.c.d";
          boolean expected = false;
          try {
            htd.addCoprocessorWithSpec(cpName);
          } catch (IllegalArgumentException iae) {
            expected = true;
          }
          if (!expected) fail();
          // Try minimal spec.
          try {
            htd.addCoprocessorWithSpec("file:///some/path" + "|" + cpName);
          } catch (IllegalArgumentException iae) {
            expected = false;
          }
          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; <<<< It should be true as it is expected to succeed.
          }
          if (expected) fail();
          // Try double add of same coprocessor
          try {
            htd.addCoprocessorWithSpec(spec);
          } catch (IOException ioe) {
            expected = true;
          }
          if (!expected) fail();
      

        Attachments

        1. HBASE-15975-v001.patch
          0.6 kB
          Hua Xiang
        2. HBASE-15975-v002.patch
          2 kB
          Hua Xiang

          Activity

            People

            • Assignee:
              huaxiang Hua Xiang
              Reporter:
              huaxiang Hua Xiang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: