Package org.syncany.database.dao

Examples of org.syncany.database.dao.FileVersionSqlDao


    Connection databaseConnection = testConfig.createDatabaseConnection();
       
    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set2.sql");

    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);       
    Map<String, FileVersion> currentFileTree = fileVersionDao.getCurrentFileTree();
   
    // Test
    assertEquals(50, currentFileTree.size());
   
    assertNotNull(currentFileTree.get("file1"));
View Full Code Here


    Connection databaseConnection = testConfig.createDatabaseConnection();
       
    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");

    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);       
   
    Map<String, FileVersion> fileTreeWithOneDatabaseVersion = fileVersionDao.getFileTreeAtDate(toDate("2014-01-01 18:00:00.000+0100"));
    Map<String, FileVersion> fileTreeWithTwoDatabaseVersions = fileVersionDao.getFileTreeAtDate(toDate("2014-01-02 18:00:00.000+0100"));
    Map<String, FileVersion> fileTreeWithThreeDatabaseVersions = fileVersionDao.getFileTreeAtDate(toDate("2014-01-03 18:00:00.000+0100"));
    Map<String, FileVersion> fileTreeWithFourDatabaseVersions = fileVersionDao.getFileTreeAtDate(toDate("2014-01-04 18:00:00.000+0100"));
    Map<String, FileVersion> fileTreeWithFiveDatabaseVersions = fileVersionDao.getFileTreeAtDate(toDate("2014-01-05 18:00:00.000+0100"));
   
    // Tests
   
    // 1. First database version
    assertEquals(1, fileTreeWithOneDatabaseVersion.size()); // Added "file1"
View Full Code Here

    Connection databaseConnection = testConfig.createDatabaseConnection();
       
    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");

    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);       
   
    FileVersion file1ByPath = fileVersionDao.getFileVersionByPath("file1");
    FileVersion file2ByPath = fileVersionDao.getFileVersionByPath("file2");
    FileVersion file3ByPath = fileVersionDao.getFileVersionByPath("file3");
    FileVersion file4ByPath = fileVersionDao.getFileVersionByPath("file4");
   
    // Test
   
    // - By Path: File 1
    assertNotNull(file1ByPath);
View Full Code Here

  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);
    this.databaseVersionDao = new DatabaseVersionSqlDao(connection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
  }
View Full Code Here

    Config configB = clientB.getConfig();
    java.sql.Connection databaseConnectionB = configB.createDatabaseConnection();

    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnectionB);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnectionB);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnectionB);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnectionB, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnectionB);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnectionB, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    Iterator<DatabaseVersion> databaseVersionsDirtyB = databaseVersionDao.getDirtyDatabaseVersions();
View Full Code Here

TOP

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

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.