hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-11050) Replace empty catch block in TestHLog#testFailedToCreateHLogIfParentRenamed with @Test(expected=)
Date Wed, 23 Apr 2014 02:18:15 GMT

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

Ted Yu updated HBASE-11050:
---------------------------

       Resolution: Fixed
    Fix Version/s: 0.99.0
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

Integrated to trunk.

Thanks for the patch, Gustavo.

> Replace empty catch block in TestHLog#testFailedToCreateHLogIfParentRenamed with @Test(expected=)

> --------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-11050
>                 URL: https://issues.apache.org/jira/browse/HBASE-11050
>             Project: HBase
>          Issue Type: Task
>            Reporter: Gustavo Anatoly
>            Assignee: Gustavo Anatoly
>            Priority: Trivial
>             Fix For: 0.99.0
>
>         Attachments: HBASE-11050.patch
>
>
> This change refactor TestHLog#testFailedToCreateHLogIfParentRenamed. The test basically
create {{HLogFactory.createWALWriter(fs, path, conf);}} and after that parent {{path}} is
renamed followed to another call {{HLogFactory.createWALWriter(fs, path, conf);}} in this
moment is expected IOException, because the parent {{path}} doesn't exist more.
> The second call monitored by a block try-catch with an empty {{catch}}:
> {code}
>  try {
>       HLogFactory.createWALWriter(fs, path, conf);
>       fail("It should fail to create the new WAL");
>     } catch (IOException ioe) {
>       // expected, good.
>     }
> {code}
> The patch proposed removes the {{try-catch}} and use {{@Test(expected=IOException.class)}}
to capture exception produced by the test.
>  



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message