|
@@ -521,7 +521,38 @@ public class TestDFSShell {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testMoveWithTargetPortEmpty() throws Exception {
|
|
|
+ Configuration conf = new HdfsConfiguration();
|
|
|
+ MiniDFSCluster cluster = null;
|
|
|
+ try {
|
|
|
+ cluster = new MiniDFSCluster.Builder(conf)
|
|
|
+ .format(true)
|
|
|
+ .numDataNodes(2)
|
|
|
+ .nameNodePort(8020)
|
|
|
+ .waitSafeMode(true)
|
|
|
+ .build();
|
|
|
+ FileSystem srcFs = cluster.getFileSystem();
|
|
|
+ FsShell shell = new FsShell();
|
|
|
+ shell.setConf(conf);
|
|
|
+ String[] argv = new String[2];
|
|
|
+ argv[0] = "-mkdir";
|
|
|
+ argv[1] = "/testfile";
|
|
|
+ ToolRunner.run(shell, argv);
|
|
|
+ argv = new String[3];
|
|
|
+ argv[0] = "-mv";
|
|
|
+ argv[1] = srcFs.getUri() + "/testfile";
|
|
|
+ argv[2] = "hdfs://localhost/testfile2";
|
|
|
+ int ret = ToolRunner.run(shell, argv);
|
|
|
+ assertEquals("mv should have succeeded", 0, ret);
|
|
|
+ } finally {
|
|
|
+ if (cluster != null) {
|
|
|
+ cluster.shutdown();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Test (timeout = 30000)
|
|
|
public void testURIPaths() throws Exception {
|
|
|
Configuration srcConf = new HdfsConfiguration();
|