hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1589331 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
Date Wed, 23 Apr 2014 02:16:00 GMT
Author: tedyu
Date: Wed Apr 23 02:16:00 2014
New Revision: 1589331

URL: http://svn.apache.org/r1589331
Log:
HBASE-11050 Replace empty catch block in TestHLog#testFailedToCreateHLogIfParentRenamed with
@Test(expected=) (Gustavo)


Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java?rev=1589331&r1=1589330&r2=1589331&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLog.java
Wed Apr 23 02:16:00 2014
@@ -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



Mime
View raw message