HADOOP-17936. Fix test failure after reverting HADOOP-16878 (#3482)
This commit is contained in:
parent
ae6cd4cea5
commit
7ed949600d
@ -27,8 +27,6 @@
|
||||
import org.apache.hadoop.fs.contract.AbstractFSContract;
|
||||
import org.apache.hadoop.fs.contract.localfs.LocalFSContract;
|
||||
|
||||
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
|
||||
|
||||
public class TestLocalFSCopyFromLocal extends AbstractContractCopyFromLocalTest {
|
||||
@Override
|
||||
protected AbstractFSContract createContract(Configuration conf) {
|
||||
@ -37,14 +35,15 @@ protected AbstractFSContract createContract(Configuration conf) {
|
||||
|
||||
@Test
|
||||
public void testDestinationFileIsToParentDirectory() throws Throwable {
|
||||
describe("Source is a file and destination is its own parent directory");
|
||||
describe("Source is a file and destination is its own parent directory. " +
|
||||
"Copying will cause the source file to be deleted.");
|
||||
|
||||
File file = createTempFile("local");
|
||||
Path dest = new Path(file.getParentFile().toURI());
|
||||
Path src = new Path(file.toURI());
|
||||
|
||||
intercept(PathOperationException.class,
|
||||
() -> getFileSystem().copyFromLocalFile( true, true, src, dest));
|
||||
getFileSystem().copyFromLocalFile(true, true, src, dest);
|
||||
assertPathDoesNotExist("Source found", src);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user