hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1584160 - in /hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase: HBaseClusterTestCase.java regionserver/wal/TestLogRolling.java
Date Wed, 02 Apr 2014 20:49:04 GMT
Author: liyin
Date: Wed Apr  2 20:49:03 2014
New Revision: 1584160

URL: http://svn.apache.org/r1584160
Log:
[master] Fix compatible problem of TestLogRolling with JUnit 4

Author: daviddeng

Summary: `setUp` and `tearDown` are marked as `@Before` and `@After` but they are not `public`,
create two public methods to call them, respectively.

Test Plan: Run `TestLogRolling`

Reviewers: manukranthk, gauravm, liyintang

Reviewed By: manukranthk

CC: hbase-eng@, fan

Differential Revision: https://phabricator.fb.com/D1223634

Task ID: 3789093

Modified:
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java?rev=1584160&r1=1584159&r2=1584160&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java
Wed Apr  2 20:49:03 2014
@@ -19,6 +19,9 @@
  */
 package org.apache.hadoop.hbase;
 
+import java.io.File;
+import java.io.PrintWriter;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.client.HConnectionManager;
@@ -29,14 +32,12 @@ import org.apache.hadoop.util.Reflection
 import org.junit.After;
 import org.junit.Before;
 
-import java.io.File;
-import java.io.PrintWriter;
-
 /**
  * Abstract base class for HBase cluster junit tests.  Spins up an hbase
  * cluster in setup and tears it down again in tearDown.
  * @deprecated Use junit4 and {@link HBaseTestingUtility}
  */
+@Deprecated
 public abstract class HBaseClusterTestCase extends HBaseTestCase {
   private static final Log LOG = LogFactory.getLog(HBaseClusterTestCase.class);
   public MiniHBaseCluster cluster;
@@ -120,8 +121,15 @@ public abstract class HBaseClusterTestCa
     // continue
   }
 
-  @Override
+  /**
+   * To be compatible with JUnit4
+   */
   @Before
+  public void setUp4() throws Exception {
+    this.setUp();
+  }
+
+  @Override
   protected void setUp() throws Exception {
     try {
       if (this.startDfs) {
@@ -164,8 +172,15 @@ public abstract class HBaseClusterTestCa
     }
   }
 
-  @Override
+  /**
+   * To be compatible with JUnit4
+   */
   @After
+  public void tearDown4() throws Exception {
+    tearDown();
+  }
+
+  @Override
   protected void tearDown() throws Exception {
     try {
       if (!openMetaTable) {

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=1584160&r1=1584159&r2=1584160&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
Wed Apr  2 20:49:03 2014
@@ -47,6 +47,7 @@ import org.apache.hadoop.hdfs.server.dat
 import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
 import org.apache.hadoop.hdfs.server.namenode.LeaseManager;
 import org.apache.log4j.Level;
+import org.junit.Test;
 import org.junit.runner.RunWith;
 
 /**
@@ -169,6 +170,7 @@ public class TestLogRolling extends HBas
    */
   // Marked as unstable and recored in #3896573
   @TestTag({ "unstable" })
+  @Test
   public void testLogRolling() throws Exception {
     this.tableName = getName();
     try {
@@ -217,6 +219,7 @@ public class TestLogRolling extends HBas
    */
   // Marked as unstable and recored in #3344583
   @TestTag({ "unstable" })
+  @Test
   public void testLogRollOnDatanodeDeath() throws Exception {
     assertTrue("This test requires HLog file replication.",
         fs.getDefaultReplication() > 1);



Mime
View raw message