use of org.syncany.plugins.transfer.files.MultichunkRemoteFile in project syncany by syncany.
the class AbstractTransferManagerTest method cleanTestLocation.
private void cleanTestLocation(TransferManager transferManager) throws StorageException {
Map<String, RemoteFile> normalFiles = transferManager.list(RemoteFile.class);
Map<String, DatabaseRemoteFile> databaseFiles = transferManager.list(DatabaseRemoteFile.class);
Map<String, MultichunkRemoteFile> multiChunkFiles = transferManager.list(MultichunkRemoteFile.class);
for (RemoteFile remoteFile : normalFiles.values()) {
transferManager.delete(remoteFile);
}
for (RemoteFile remoteFile : databaseFiles.values()) {
transferManager.delete(remoteFile);
}
for (RemoteFile remoteFile : multiChunkFiles.values()) {
transferManager.delete(remoteFile);
}
}
use of org.syncany.plugins.transfer.files.MultichunkRemoteFile in project syncany by syncany.
the class AbstractTransferManagerTest method testUploadListDownloadAndDelete.
@Test
public void testUploadListDownloadAndDelete() throws Exception {
// Setup
File tempFromDir = TestFileUtil.createTempDirectoryInSystemTemp();
File tempToDir = TestFileUtil.createTempDirectoryInSystemTemp();
// Create connection, upload, list, download
TransferManager transferManager = loadPluginAndCreateTransferManager();
transferManager.init(true);
transferManager.connect();
// Clear up previous test (if test location is reused)
cleanTestLocation(transferManager);
// Run!
uploadDownloadListDelete(transferManager, tempFromDir, tempToDir, SyncanyRemoteFile.class, new SyncanyRemoteFile[] { new SyncanyRemoteFile() });
uploadDownloadListDelete(transferManager, tempFromDir, tempToDir, MasterRemoteFile.class, new MasterRemoteFile[] { new MasterRemoteFile() });
uploadDownloadListDelete(transferManager, tempFromDir, tempToDir, DatabaseRemoteFile.class, new DatabaseRemoteFile[] { new DatabaseRemoteFile("database-A-0001"), new DatabaseRemoteFile("database-B-0002") });
uploadDownloadListDelete(transferManager, tempFromDir, tempToDir, MultichunkRemoteFile.class, new MultichunkRemoteFile[] { new MultichunkRemoteFile("multichunk-84f7e2b31440aaef9b73de3cadcf4e449aeb55a1"), new MultichunkRemoteFile("multichunk-beefbeefbeefbeefbeefbeefbeefbeefbeefbeef"), new MultichunkRemoteFile("multichunk-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") });
// Clear up previous test (if test location is reused)
cleanTestLocation(transferManager);
// Clean local location
TestFileUtil.deleteDirectory(tempFromDir);
TestFileUtil.deleteDirectory(tempToDir);
}
use of org.syncany.plugins.transfer.files.MultichunkRemoteFile in project syncany by syncany.
the class AbstractTransferManagerTest method testDeleteNonExistentFile.
@Test
public void testDeleteNonExistentFile() throws StorageException {
TransferManager transferManager = loadPluginAndCreateTransferManager();
transferManager.connect();
// does not
boolean deleteSuccess = transferManager.delete(new MultichunkRemoteFile("multichunk-dddddddddddddddddddddddddddddddddddddddd"));
// exist
assertTrue(deleteSuccess);
}
Aggregations