|
@@ -50,7 +50,7 @@ import org.junit.Test;
|
|
* underlying file system as Hdfs.
|
|
* underlying file system as Hdfs.
|
|
*/
|
|
*/
|
|
public class TestResolveHdfsSymlink {
|
|
public class TestResolveHdfsSymlink {
|
|
- private static File TEST_ROOT_DIR = PathUtils.getTestDir(TestResolveHdfsSymlink.class);
|
|
|
|
|
|
+ private static FileContextTestHelper helper = new FileContextTestHelper();
|
|
private static MiniDFSCluster cluster = null;
|
|
private static MiniDFSCluster cluster = null;
|
|
|
|
|
|
@BeforeClass
|
|
@BeforeClass
|
|
@@ -82,13 +82,14 @@ public class TestResolveHdfsSymlink {
|
|
FileContext fcHdfs = FileContext.getFileContext(cluster.getFileSystem()
|
|
FileContext fcHdfs = FileContext.getFileContext(cluster.getFileSystem()
|
|
.getUri());
|
|
.getUri());
|
|
|
|
|
|
|
|
+ final String localTestRoot = helper.getAbsoluteTestRootDir(fcLocal);
|
|
Path alphaLocalPath = new Path(fcLocal.getDefaultFileSystem().getUri()
|
|
Path alphaLocalPath = new Path(fcLocal.getDefaultFileSystem().getUri()
|
|
- .toString(), new File(TEST_ROOT_DIR, "alpha").getAbsolutePath());
|
|
|
|
|
|
+ .toString(), new File(localTestRoot, "alpha").getAbsolutePath());
|
|
DFSTestUtil.createFile(FileSystem.getLocal(conf), alphaLocalPath, 16,
|
|
DFSTestUtil.createFile(FileSystem.getLocal(conf), alphaLocalPath, 16,
|
|
(short) 1, 2);
|
|
(short) 1, 2);
|
|
|
|
|
|
Path linkTarget = new Path(fcLocal.getDefaultFileSystem().getUri()
|
|
Path linkTarget = new Path(fcLocal.getDefaultFileSystem().getUri()
|
|
- .toString(), TEST_ROOT_DIR.getAbsolutePath());
|
|
|
|
|
|
+ .toString(), localTestRoot);
|
|
Path hdfsLink = new Path(fcHdfs.getDefaultFileSystem().getUri().toString(),
|
|
Path hdfsLink = new Path(fcHdfs.getDefaultFileSystem().getUri().toString(),
|
|
"/tmp/link");
|
|
"/tmp/link");
|
|
fcHdfs.createSymlink(linkTarget, hdfsLink, true);
|
|
fcHdfs.createSymlink(linkTarget, hdfsLink, true);
|