HBASE-6149 Fix TestFSUtils creating dirs under top level dir

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1345343 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-06-01 20:43:33 +00:00
parent f05b600cf4
commit a21f01014a
1 changed files with 4 additions and 4 deletions

View File

@ -216,14 +216,15 @@ public class TestFSUtils {
@Test
public void testDeleteAndExists() throws Exception {
Configuration conf = HBaseConfiguration.create();
HBaseTestingUtility htu = new HBaseTestingUtility();
Configuration conf = htu.getConfiguration();
conf.setBoolean(HConstants.ENABLE_DATA_FILE_UMASK, true);
FileSystem fs = FileSystem.get(conf);
FsPermission perms = FSUtils.getFilePermissions(fs, conf, HConstants.DATA_FILE_UMASK_KEY);
// then that the correct file is created
String file = UUID.randomUUID().toString();
Path p = new Path("temptarget" + File.separator + file);
Path p1 = new Path("temppath" + File.separator + file);
Path p = new Path(htu.getDataTestDir(), "temptarget" + File.separator + file);
Path p1 = new Path(htu.getDataTestDir(), "temppath" + File.separator + file);
try {
FSDataOutputStream out = FSUtils.create(fs, p, perms);
out.close();
@ -247,4 +248,3 @@ public class TestFSUtils {
public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu =
new org.apache.hadoop.hbase.ResourceCheckerJUnitRule();
}