|
17 | 17 | * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch |
18 | 18 | */ |
19 | 19 |
|
| 20 | +import ch.cyberduck.core.AlphanumericRandomStringService; |
20 | 21 | import ch.cyberduck.core.DisabledConnectionCallback; |
21 | 22 | import ch.cyberduck.core.DisabledLoginCallback; |
22 | 23 | import ch.cyberduck.core.Path; |
@@ -63,6 +64,20 @@ public void testMoveOverride() throws Exception { |
63 | 64 | new SFTPDeleteFeature(session).delete(Collections.<Path>singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); |
64 | 65 | } |
65 | 66 |
|
| 67 | + @Test |
| 68 | + public void testMoveOverrideDirectory() throws Exception { |
| 69 | + final Path workdir = new SFTPHomeDirectoryService(session).find(); |
| 70 | + final Path test = new Path(workdir, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); |
| 71 | + new SFTPDirectoryFeature(session).mkdir(test, new TransferStatus()); |
| 72 | + final Path target = new Path(workdir, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); |
| 73 | + new SFTPDirectoryFeature(session).mkdir(target, new TransferStatus()); |
| 74 | + new SFTPTouchFeature(session).touch(new Path(target, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus()); |
| 75 | + new SFTPMoveFeature(session).move(test, target, new TransferStatus().exists(true), new Delete.DisabledCallback(), new DisabledConnectionCallback()); |
| 76 | + assertFalse(new SFTPFindFeature(session).find(test)); |
| 77 | + assertTrue(new SFTPFindFeature(session).find(target)); |
| 78 | + new SFTPDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback()); |
| 79 | + } |
| 80 | + |
66 | 81 | @Test(expected = NotfoundException.class) |
67 | 82 | public void testMoveNotFound() throws Exception { |
68 | 83 | final Path workdir = new SFTPHomeDirectoryService(session).find(); |
|
0 commit comments