use of org.syncany.tests.integration.scenarios.framework.CreateFileTree in project syncany by syncany.
the class FileLockedScenarioTest method testLockUnlockFile.
@Test
public void testLockUnlockFile() throws Exception {
final TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
final TestClient clientA = new TestClient("A", testConnection);
final TestClient clientB = new TestClient("B", testConnection);
ClientActions.run(clientA, null, new CreateFileTree(), new Executable() {
@Override
public void execute() throws Exception {
clientA.upWithForceChecksum();
clientB.down();
assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
}
});
ClientActions.run(clientA, null, new LockFile(), new Executable() {
@Override
public void execute() throws Exception {
clientA.upWithForceChecksum();
clientB.down();
assertEquals(clientA.getLocalFilesExcludeLockedAndNoRead().size(), clientB.getLocalFilesExcludeLockedAndNoRead().size() - 1);
}
});
ClientActions.run(clientA, null, new UnlockFile(), new Executable() {
@Override
public void execute() throws Exception {
clientA.upWithForceChecksum();
clientB.down();
assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
}
});
clientA.deleteTestData();
clientB.deleteTestData();
}
use of org.syncany.tests.integration.scenarios.framework.CreateFileTree in project syncany by syncany.
the class ChangedTypeScenarioTest method testChangeTypeToFolder.
@Test
public void testChangeTypeToFolder() throws Exception {
final TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
final TestClient clientA = new TestClient("A", testConnection);
final TestClient clientB = new TestClient("B", testConnection);
ClientActions.run(clientA, null, new AbstractClientAction[] { new CreateFileTree(), new ChangeTypeFileToFolder() }, new Executable() {
@Override
public void execute() throws Exception {
clientA.upWithForceChecksum();
clientB.down();
assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
}
});
clientA.deleteTestData();
clientB.deleteTestData();
}
use of org.syncany.tests.integration.scenarios.framework.CreateFileTree in project syncany by syncany.
the class AllFilePossibilitiesScenarioTest method testChangeTypeSymlinkWithTargetFileToFolder.
@Test
public void testChangeTypeSymlinkWithTargetFileToFolder() throws Exception {
final TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
final TestClient clientA = new TestClient("A", testConnection);
final TestClient clientB = new TestClient("B", testConnection);
ClientActions.run(clientA, null, new CreateFileTree(), null);
ClientActions.run(clientA, null, new ChangeTypeFileToSymlinkWithTargetFolder(), null);
clientA.upWithForceChecksum();
clientB.down();
assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
clientA.deleteTestData();
clientB.deleteTestData();
}
use of org.syncany.tests.integration.scenarios.framework.CreateFileTree in project syncany by syncany.
the class AllFilePossibilitiesScenarioTest method testAllPossibilities.
@Test
public void testAllPossibilities() throws Exception {
final TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
final TestClient clientA = new TestClient("A", testConnection);
final TestClient clientB = new TestClient("B", testConnection);
ClientActions.run(clientA, new Executable() {
@Override
public void execute() throws Exception {
// Nothing.
}
}, new AbstractClientAction[] { new CreateFileTree(), new ChangeContentWithoutFileSize(), new ChangeFileSize(), new ChangeLastModifiedDate(), new ChangePermissionsOfFile(), new ChangePermissionsOfFolder(), new ChangeSymlinkTarget(), new ChangeTypeFileToFolder(), new ChangeTypeFileToSymlinkWithNonExistingTarget(), new ChangeTypeFileToSymlinkWithTargetFile(), new ChangeTypeFileToSymlinkWithTargetFolder(), new ChangeTypeSymlinkWithNonExistingTargetToFile(), new ChangeTypeSymlinkWithTargetFileToFile(), new ChangeTypeSymlinkWithTargetFolderToFile(), new ChangeTypeSymlinkWithNonExistingTargetToFolder(), new ChangeTypeSymlinkWithTargetFileToFolder(), new ChangeTypeSymlinkWithTargetFolderToFolder(), new ChangeTypeFolderToFile(), new ChangeTypeFolderToSymlinkWithNonExistingTarget(), new ChangeTypeFolderToSymlinkWithTargetFile(), new ChangeTypeFolderToSymlinkWithTargetFolder(), new CreateFile(), new CreateFolder(), new CreateSymlinkToFile(), new CreateSymlinkToFolder(), new CreateSymlinkToNonExisting(), new DeleteFile(), new DeleteFolder(), new MoveFileToOtherFolder(), new MoveFileWithinFolder(), new MoveFolderToOtherFolder(), new MoveFolderWithinFolder() }, new Executable() {
@Override
public void execute() throws Exception {
clientA.upWithForceChecksum();
clientB.down();
assertFileListEquals(clientA.getLocalFilesExcludeLockedAndNoRead(), clientB.getLocalFilesExcludeLockedAndNoRead());
assertSqlDatabaseEquals(clientA.getDatabaseFile(), clientB.getDatabaseFile());
}
});
clientA.deleteTestData();
clientB.deleteTestData();
}
Aggregations