hbase-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/HBASE-11050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977732#comment-13977732
] 

Srikanth Srungarapu commented on HBASE-11050:
---------------------------------------------

Nice description :)

> Replace empty expected catch block (TestHLog#testFailedToCreateHLogIfParentRenamed) for
@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
>         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