Package org.syncany.database.dao

Examples of org.syncany.database.dao.ApplicationSqlDao


    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set3.sql");

    ApplicationSqlDao applicationDao = new ApplicationSqlDao(databaseConnection);
    List<DatabaseRemoteFile> actualKnownDatabases = applicationDao.getKnownDatabases();

    // Test
    assertTrue(CollectionUtil.containsExactly(Arrays.asList(new DatabaseRemoteFile[] {
        new DatabaseRemoteFile("database-B-0000000001"),
        new DatabaseRemoteFile("database-B-0000000002"),
View Full Code Here


    // Setup
    Config testConfig = TestConfigUtil.createTestLocalConfig();
    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Run
    ApplicationSqlDao applicationDao = new ApplicationSqlDao(databaseConnection);

    List<DatabaseRemoteFile> expectedKnownDatabases = Arrays.asList(new DatabaseRemoteFile[] {
        new DatabaseRemoteFile("database-A-0000000001"),
        new DatabaseRemoteFile("database-V-0000000001"),
        new DatabaseRemoteFile("database-B-0000000001"),
        new DatabaseRemoteFile("database-A-0000000002")
    });

    applicationDao.writeKnownRemoteDatabases(expectedKnownDatabases);
    List<DatabaseRemoteFile> actualKnownDatabases = applicationDao.getKnownDatabases();

    // Test
    assertTrue(CollectionUtil.containsExactly(expectedKnownDatabases, actualKnownDatabases));

    // Tear down
View Full Code Here

    // Setup
    Config testConfig = TestConfigUtil.createTestLocalConfig();
    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Prepare
    ApplicationSqlDao applicationDao = new ApplicationSqlDao(databaseConnection);

    List<DatabaseRemoteFile> expectedKnownDatabases = Arrays.asList(new DatabaseRemoteFile[] {
        new DatabaseRemoteFile("database-A-0000000001")
    });

    applicationDao.writeKnownRemoteDatabases(expectedKnownDatabases);

    // Run & Test
    assertTrue(new File(testConfig.getDatabaseFile() + ".lck").exists());
    applicationDao.shutdown();
    assertFalse(new File(testConfig.getDatabaseFile() + ".lck").exists());

    // Tear down
    databaseConnection.close();
    TestConfigUtil.deleteTestLocalConfigAndData(testConfig);
View Full Code Here

  protected MultiChunkSqlDao multiChunkDao;
  protected DatabaseVersionSqlDao databaseVersionDao;

  public SqlDatabase(Config config) {
    this.connection = config.createDatabaseConnection();
    this.applicationDao = new ApplicationSqlDao(connection);
    this.chunkDao = new ChunkSqlDao(connection);
    this.fileContentDao = new FileContentSqlDao(connection);
    this.fileVersionDao = new FileVersionSqlDao(connection);
    this.fileHistoryDao = new FileHistorySqlDao(connection, fileVersionDao);
    this.multiChunkDao = new MultiChunkSqlDao(connection);
View Full Code Here

TOP

Related Classes of org.syncany.database.dao.ApplicationSqlDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.