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

Gustavo Anatoly updated HBASE-11050:
------------------------------------

    Description: 
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.

 

> 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)

Reply via email to