hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1454244 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java
Date Fri, 08 Mar 2013 04:34:19 GMT
Author: tedyu
Date: Fri Mar  8 04:34:19 2013
New Revision: 1454244

URL: http://svn.apache.org/r1454244
Log:
HBASE-7960 cleanup TestDir in TestHalfStoreFileReader (Liang Xie)


Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java?rev=1454244&r1=1454243&r2=1454244&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java
Fri Mar  8 04:34:19 2013
@@ -36,11 +36,24 @@ import org.apache.hadoop.hbase.io.encodi
 import org.apache.hadoop.hbase.io.hfile.HFile;
 import org.apache.hadoop.hbase.io.hfile.HFileScanner;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 @Category(SmallTests.class)
 public class TestHalfStoreFileReader {
+  private static HBaseTestingUtility TEST_UTIL;
+
+  @BeforeClass
+  public static void setupBeforeClass() throws Exception {
+    TEST_UTIL = new HBaseTestingUtility();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    TEST_UTIL.cleanupTestDir();
+  }
 
   /**
    * Test the scanner and reseek of a half hfile scanner. The scanner API
@@ -60,11 +73,10 @@ public class TestHalfStoreFileReader {
    */
   @Test
   public void testHalfScanAndReseek() throws IOException {
-    HBaseTestingUtility test_util = new HBaseTestingUtility();
-    String root_dir = test_util.getDataTestDir("TestHalfStoreFile").toString();
+    String root_dir = TEST_UTIL.getDataTestDir("TestHalfStoreFile").toString();
     Path p = new Path(root_dir, "test");
 
-    Configuration conf = test_util.getConfiguration();
+    Configuration conf = TEST_UTIL.getConfiguration();
     FileSystem fs = FileSystem.get(conf);
     CacheConfig cacheConf = new CacheConfig(conf);
 
@@ -128,10 +140,9 @@ public class TestHalfStoreFileReader {
   // Tests the scanner on an HFile that is backed by HalfStoreFiles
   @Test
   public void testHalfScanner() throws IOException {
-      HBaseTestingUtility test_util = new HBaseTestingUtility();
-      String root_dir = test_util.getDataTestDir("TestHalfStoreFileScanBefore").toString();
+      String root_dir = TEST_UTIL.getDataTestDir("TestHalfStoreFileScanBefore").toString();
       Path p = new Path(root_dir, "test");
-      Configuration conf = test_util.getConfiguration();
+      Configuration conf = TEST_UTIL.getConfiguration();
       FileSystem fs = FileSystem.get(conf);
       CacheConfig cacheConf = new CacheConfig(conf);
 



Mime
View raw message