@Test(timeout = 10000) public void testDirectoryCpWithP() throws Exception { run(new Cp(), "-p", "d1", "d3"); assertEquals(fs.getFileStatus(new Path("d1")).getModificationTime(), fs.getFileStatus(new Path("d3")).getModificationTime()); assertEquals(fs.getFileStatus(new Path("d1")).getPermission(), fs.getFileStatus(new Path("d3")).getPermission()); }
@Test(timeout = 10000) public void testDirectoryCpWithoutP() throws Exception { run(new Cp(), "d1", "d4"); assertTrue(fs.getFileStatus(new Path("d1")).getModificationTime() != fs.getFileStatus(new Path("d4")).getModificationTime()); assertTrue(!fs.getFileStatus(new Path("d1")).getPermission() .equals(fs.getFileStatus(new Path("d4")).getPermission())); }
@Test(timeout = 10000) public void testCpWithP() throws Exception { run(new Cp(), "-p", FROM.toString(), TO.toString()); assertAttributesPreserved(TO); }
@Test(timeout = 10000) public void testCpWithoutP() throws Exception { run(new Cp(), FROM.toString(), TO.toString()); assertAttributesChanged(TO); }
@Test(timeout = 10000) public void testDirectoryCpWithP() throws Exception { run(new Cp(), "-p", DIR_FROM.toString(), DIR_TO2.toString()); assertAttributesPreserved(DIR_TO2); }
@Test(timeout = 10000) public void testDirectoryCpWithoutP() throws Exception { run(new Cp(), DIR_FROM.toString(), DIR_TO2.toString()); assertAttributesChanged(DIR_TO2); }
@Test(timeout = 10000) public void testCpWithP() throws Exception { run(new Cp(), "-p", FROM.toString(), TO.toString()); assertAttributesPreserved(); }
@Test(timeout = 10000) public void testCpWithoutP() throws Exception { run(new Cp(), FROM.toString(), TO.toString()); assertAttributesChanged(); }