You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "huaxiang sun (JIRA)" <ji...@apache.org> on 2016/06/07 00:39:21 UTC

[jira] [Updated] (HBASE-15975) logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong

     [ https://issues.apache.org/jira/browse/HBASE-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

huaxiang sun updated HBASE-15975:
---------------------------------
    Status: Patch Available  (was: Open)

> logic in TestHTableDescriptor#testAddCoprocessorWithSpecStr is wrong
> --------------------------------------------------------------------
>
>                 Key: HBASE-15975
>                 URL: https://issues.apache.org/jira/browse/HBASE-15975
>             Project: HBase
>          Issue Type: Bug
>          Components: test
>    Affects Versions: master
>            Reporter: huaxiang sun
>            Assignee: huaxiang sun
>            Priority: Trivial
>         Attachments: HBASE-15975-v001.patch
>
>
> While working on an unitest case for HBASE-14644, crossed over 
> testAddCoprocessorWithSpecStr().
> {code}
>    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();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)