use of org.syncany.tests.integration.scenarios.framework.UnlockFile 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();
}
Aggregations