Package org.syncany.database.dao

Examples of org.syncany.database.dao.FileHistorySqlDao


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

    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
   
    Map<FileHistoryId, PartialFileHistory> historiesFromA1 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("A1"));
    Map<FileHistoryId, PartialFileHistory> historiesFromA2 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("A2"));
    Map<FileHistoryId, PartialFileHistory> historiesFromA3 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("A3"));
    Map<FileHistoryId, PartialFileHistory> historiesFromA4 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("A4"));
    Map<FileHistoryId, PartialFileHistory> historiesFromA5 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("A5"));
    Map<FileHistoryId, PartialFileHistory> historiesFromB1 = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("B1"));
    Map<FileHistoryId, PartialFileHistory> historiesFromDoesNotExist = fileHistoryDao.getFileHistoriesWithFileVersions(TestDatabaseUtil.createVectorClock("DoesNotExist1"));
   
    // Test   
    assertNotNull(historiesFromA1);
    assertEquals(1, historiesFromA1.size());
    assertEquals("851c441915478a539a5bab2b263ffa4cc48e282f", historiesFromA1.get(FileHistoryId.parseFileId("851c441915478a539a5bab2b263ffa4cc48e282f")).getFileHistoryId().toString());
View Full Code Here


    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    Iterator<DatabaseVersion> databaseVersionsDirty = databaseVersionDao.getDirtyDatabaseVersions();
   
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    Iterator<DatabaseVersion> databaseVersionsToA2 = databaseVersionDao.getDatabaseVersionsTo("A", 2);
    Iterator<DatabaseVersion> databaseVersionsToA5 = databaseVersionDao.getDatabaseVersionsTo("A", 5);
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set3.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    DatabaseVersionHeader lastDatabaseVersionHeader = databaseVersionDao.getLastDatabaseVersionHeader();
   
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    // a. Capture database version header (now)
    DatabaseVersionHeader lastDatabaseVersionHeaderBefore = databaseVersionDao.getLastDatabaseVersionHeader();
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set3.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    DatabaseBranch localDatabaseBranch = databaseVersionDao.getLocalDatabaseBranch();
   
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    DatabaseBranch localDatabaseBranch = databaseVersionDao.getLocalDatabaseBranch();
   
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
   
    Long maxDirtyVectorClockA = databaseVersionDao.getMaxDirtyVectorClock("A");
    Long maxDirtyVectorClockB = databaseVersionDao.getMaxDirtyVectorClock("B");
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set2.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);
       
    databaseVersionDao.markDatabaseVersionDirty(TestDatabaseUtil.createVectorClock("A48"));
    databaseVersionDao.markDatabaseVersionDirty(TestDatabaseUtil.createVectorClock("A49"));
View Full Code Here

    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
    MultiChunkSqlDao multiChunkDao = new MultiChunkSqlDao(databaseConnection);
    FileVersionSqlDao fileVersionDao = new FileVersionSqlDao(databaseConnection);
    FileHistorySqlDao fileHistoryDao = new FileHistorySqlDao(databaseConnection, fileVersionDao);
    FileContentSqlDao fileContentDao = new FileContentSqlDao(databaseConnection);
    DatabaseVersionSqlDao databaseVersionDao = new DatabaseVersionSqlDao(databaseConnection, chunkDao, fileContentDao, fileVersionDao, fileHistoryDao, multiChunkDao);

    // a. Test before
    List<DatabaseVersion> dirtyDatabaseVersionsBefore = TestCollectionUtil.toList(databaseVersionDao.getDirtyDatabaseVersions());   
View Full Code Here

TOP

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

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.