diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java index b1a5b7af739..9e7340fafeb 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionTool.java @@ -19,9 +19,6 @@ package org.apache.hadoop.hbase.regionserver; import static org.junit.Assert.assertEquals; -import java.io.File; -import java.io.FileOutputStream; - import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; @@ -60,12 +57,6 @@ public class TestCompactionTool { public void setUp() throws Exception { this.testUtil.startMiniCluster(); testUtil.createTable(tableName, HBaseTestingUtility.fam1); - String defaultFS = testUtil.getMiniHBaseCluster().getConfiguration().get("fs.defaultFS"); - Configuration config = HBaseConfiguration.create(); - config.set("fs.defaultFS", defaultFS); - String configPath = this.getClass().getClassLoader() - .getResource("hbase-site.xml").getFile(); - config.writeXml(new FileOutputStream(new File(configPath))); rootDir = testUtil.getDefaultRootDirPath(); this.region = testUtil.getMiniHBaseCluster().getRegions(tableName).get(0); } @@ -89,7 +80,10 @@ public class TestCompactionTool { + Bytes.toString(HBaseTestingUtility.fam1); FileStatus[] regionDirFiles = fs.listStatus(new Path(storePath)); assertEquals(10, regionDirFiles.length); - int result = ToolRunner.run(HBaseConfiguration.create(), new CompactionTool(), + String defaultFS = testUtil.getMiniHBaseCluster().getConfiguration().get("fs.defaultFS"); + Configuration config = HBaseConfiguration.create(); + config.set("fs.defaultFS", defaultFS); + int result = ToolRunner.run(config, new CompactionTool(), new String[]{"-compactOnce", "-major", storePath}); assertEquals(0,result); regionDirFiles = fs.listStatus(new Path(storePath));