|
@@ -123,18 +123,20 @@ public class TestFsShellReturnCode {
|
|
*/
|
|
*/
|
|
@Test
|
|
@Test
|
|
public void testChmod() throws Exception {
|
|
public void testChmod() throws Exception {
|
|
|
|
+ Path p1 = new Path(TEST_ROOT_DIR, "testChmod/fileExists");
|
|
|
|
|
|
- final String f1 = TEST_ROOT_DIR + "/" + "testChmod/fileExists";
|
|
|
|
- final String f2 = TEST_ROOT_DIR + "/" + "testChmod/fileDoesNotExist";
|
|
|
|
- final String f3 = TEST_ROOT_DIR + "/" + "testChmod/nonExistingfiles*";
|
|
|
|
|
|
+ final String f1 = p1.toUri().getPath();
|
|
|
|
+ final String f2 = new Path(TEST_ROOT_DIR, "testChmod/fileDoesNotExist")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
+ final String f3 = new Path(TEST_ROOT_DIR, "testChmod/nonExistingfiles*")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
|
|
- Path p1 = new Path(f1);
|
|
|
|
|
|
+ final Path p4 = new Path(TEST_ROOT_DIR, "testChmod/file1");
|
|
|
|
+ final Path p5 = new Path(TEST_ROOT_DIR, "testChmod/file2");
|
|
|
|
+ final Path p6 = new Path(TEST_ROOT_DIR, "testChmod/file3");
|
|
|
|
|
|
- final Path p4 = new Path(TEST_ROOT_DIR + "/" + "testChmod/file1");
|
|
|
|
- final Path p5 = new Path(TEST_ROOT_DIR + "/" + "testChmod/file2");
|
|
|
|
- final Path p6 = new Path(TEST_ROOT_DIR + "/" + "testChmod/file3");
|
|
|
|
-
|
|
|
|
- final String f7 = TEST_ROOT_DIR + "/" + "testChmod/file*";
|
|
|
|
|
|
+ final String f7 = new Path(TEST_ROOT_DIR, "testChmod/file*").toUri()
|
|
|
|
+ .getPath();
|
|
|
|
|
|
// create and write test file
|
|
// create and write test file
|
|
writeFile(fileSys, p1);
|
|
writeFile(fileSys, p1);
|
|
@@ -177,18 +179,21 @@ public class TestFsShellReturnCode {
|
|
*/
|
|
*/
|
|
@Test
|
|
@Test
|
|
public void testChown() throws Exception {
|
|
public void testChown() throws Exception {
|
|
|
|
+ Path p1 = new Path(TEST_ROOT_DIR, "testChown/fileExists");
|
|
|
|
|
|
- final String f1 = TEST_ROOT_DIR + "/" + "testChown/fileExists";
|
|
|
|
- final String f2 = TEST_ROOT_DIR + "/" + "testChown/fileDoesNotExist";
|
|
|
|
- final String f3 = TEST_ROOT_DIR + "/" + "testChown/nonExistingfiles*";
|
|
|
|
|
|
+ final String f1 = p1.toUri().getPath();
|
|
|
|
+ final String f2 = new Path(TEST_ROOT_DIR, "testChown/fileDoesNotExist")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
+ final String f3 = new Path(TEST_ROOT_DIR, "testChown/nonExistingfiles*")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
|
|
- Path p1 = new Path(f1);
|
|
|
|
|
|
|
|
- final Path p4 = new Path(TEST_ROOT_DIR + "/" + "testChown/file1");
|
|
|
|
- final Path p5 = new Path(TEST_ROOT_DIR + "/" + "testChown/file2");
|
|
|
|
- final Path p6 = new Path(TEST_ROOT_DIR + "/" + "testChown/file3");
|
|
|
|
|
|
+ final Path p4 = new Path(TEST_ROOT_DIR, "testChown/file1");
|
|
|
|
+ final Path p5 = new Path(TEST_ROOT_DIR, "testChown/file2");
|
|
|
|
+ final Path p6 = new Path(TEST_ROOT_DIR, "testChown/file3");
|
|
|
|
|
|
- final String f7 = TEST_ROOT_DIR + "/" + "testChown/file*";
|
|
|
|
|
|
+ final String f7 = new Path(TEST_ROOT_DIR, "testChown/file*").toUri()
|
|
|
|
+ .getPath();
|
|
|
|
|
|
// create and write test file
|
|
// create and write test file
|
|
writeFile(fileSys, p1);
|
|
writeFile(fileSys, p1);
|
|
@@ -230,18 +235,20 @@ public class TestFsShellReturnCode {
|
|
*/
|
|
*/
|
|
@Test
|
|
@Test
|
|
public void testChgrp() throws Exception {
|
|
public void testChgrp() throws Exception {
|
|
|
|
+ Path p1 = new Path(TEST_ROOT_DIR, "testChgrp/fileExists");
|
|
|
|
|
|
- final String f1 = TEST_ROOT_DIR + "/" + "testChgrp/fileExists";
|
|
|
|
- final String f2 = TEST_ROOT_DIR + "/" + "testChgrp/fileDoesNotExist";
|
|
|
|
- final String f3 = TEST_ROOT_DIR + "/" + "testChgrp/nonExistingfiles*";
|
|
|
|
-
|
|
|
|
- Path p1 = new Path(f1);
|
|
|
|
|
|
+ final String f1 = p1.toUri().getPath();
|
|
|
|
+ final String f2 = new Path(TEST_ROOT_DIR, "testChgrp/fileDoesNotExist")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
+ final String f3 = new Path(TEST_ROOT_DIR, "testChgrp/nonExistingfiles*")
|
|
|
|
+ .toUri().getPath();
|
|
|
|
|
|
- final Path p4 = new Path(TEST_ROOT_DIR + "/" + "testChgrp/file1");
|
|
|
|
- final Path p5 = new Path(TEST_ROOT_DIR + "/" + "testChgrp/file2");
|
|
|
|
- final Path p6 = new Path(TEST_ROOT_DIR + "/" + "testChgrp/file3");
|
|
|
|
|
|
+ final Path p4 = new Path(TEST_ROOT_DIR, "testChgrp/file1");
|
|
|
|
+ final Path p5 = new Path(TEST_ROOT_DIR, "testChgrp/file2");
|
|
|
|
+ final Path p6 = new Path(TEST_ROOT_DIR, "testChgrp/file3");
|
|
|
|
|
|
- final String f7 = TEST_ROOT_DIR + "/" + "testChgrp/file*";
|
|
|
|
|
|
+ final String f7 = new Path(TEST_ROOT_DIR, "testChgrp/file*").toUri()
|
|
|
|
+ .getPath();
|
|
|
|
|
|
// create and write test file
|
|
// create and write test file
|
|
writeFile(fileSys, p1);
|
|
writeFile(fileSys, p1);
|
|
@@ -288,8 +295,8 @@ public class TestFsShellReturnCode {
|
|
fileSys.mkdirs(tdir);
|
|
fileSys.mkdirs(tdir);
|
|
String[] args = new String[3];
|
|
String[] args = new String[3];
|
|
args[0] = "-get";
|
|
args[0] = "-get";
|
|
- args[1] = tdir+"/invalidSrc";
|
|
|
|
- args[2] = tdir+"/invalidDst";
|
|
|
|
|
|
+ args[1] = new Path(tdir.toUri().getPath(), "/invalidSrc").toString();
|
|
|
|
+ args[2] = new Path(tdir.toUri().getPath(), "/invalidDst").toString();
|
|
assertTrue("file exists", !fileSys.exists(new Path(args[1])));
|
|
assertTrue("file exists", !fileSys.exists(new Path(args[1])));
|
|
assertTrue("file exists", !fileSys.exists(new Path(args[2])));
|
|
assertTrue("file exists", !fileSys.exists(new Path(args[2])));
|
|
int run = shell.run(args);
|
|
int run = shell.run(args);
|