use of diskCacheV111.vehicles.PnfsCreateUploadPath in project dcache by dCache.
the class PnfsManagerTest method testCancelUploadRecursively.
@Test
public void testCancelUploadRecursively() throws ChimeraFsException {
FsPath root = FsPath.ROOT;
FsPath path = FsPath.create("/test");
PnfsCreateUploadPath create = new PnfsCreateUploadPath(Subjects.ROOT, Restrictions.none(), path, root, null, null, null, null, EnumSet.noneOf(CreateOption.class));
_pnfsManager.createUploadPath(create);
assertThat(create.getReturnCode(), is(0));
_fs.createFile(create.getUploadPath().toString());
_fs.mkdir(create.getUploadPath().parent() + "/bar");
_fs.mkdir(create.getUploadPath().parent() + "/baz");
_fs.createFile(create.getUploadPath().parent() + "/baz/baz");
PnfsCancelUpload cancel = new PnfsCancelUpload(Subjects.ROOT, Restrictions.none(), create.getUploadPath(), path, EnumSet.noneOf(FileAttribute.class), "request aborted");
_pnfsManager.cancelUpload(cancel);
assertThat(cancel.getReturnCode(), is(0));
assertNotExists(create.getUploadPath().toString());
assertNotExists("/test");
}
Aggregations