HBASE-11050 Replace empty catch block in TestHLog#testFailedToCreateHLogIfParentRenamed with @Test(expected=) (Gustavo)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1589331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-04-23 02:16:00 +00:00
parent 4bf297b2d9
commit b55ff6d5af
1 changed files with 3 additions and 7 deletions

View File

@ -685,7 +685,7 @@ public class TestHLog {
}
}
@Test
@Test(expected=IOException.class)
public void testFailedToCreateHLogIfParentRenamed() throws IOException {
FSHLog log = (FSHLog)HLogFactory.createHLog(
fs, hbaseDir, "testFailedToCreateHLogIfParentRenamed", conf);
@ -696,12 +696,8 @@ public class TestHLog {
path = log.computeFilename(filenum + 1);
Path newPath = new Path(parent.getParent(), parent.getName() + "-splitting");
fs.rename(parent, newPath);
try {
HLogFactory.createWALWriter(fs, path, conf);
fail("It should fail to create the new WAL");
} catch (IOException ioe) {
// expected, good.
}
HLogFactory.createWALWriter(fs, path, conf);
fail("It should fail to create the new WAL");
}
@Test