Package org.syncany.config

Examples of org.syncany.config.Config


  }
 
  @Test
  public void testConfigHelperFindLocalDirInPathTwoLevelsDown() throws Exception {
    // Setup
    Config testConfig = TestConfigUtil.createTestLocalConfig();
    new File(testConfig.getAppDir()+"/some/folder").mkdirs();
   
    File startingPath = new File(testConfig.getAppDir()+"/some/folder");
   
    // Run
    File actualLocalDir = ConfigHelper.findLocalDirInPath(startingPath);
   
    // Test
    assertNotNull(actualLocalDir);
    assertEquals(testConfig.getLocalDir(), actualLocalDir.getCanonicalFile());
   
    // Tear down
    TestConfigUtil.deleteTestLocalConfigAndData(testConfig);   
  }
View Full Code Here


    RepoTO repoTO = new RepoTO();
    repoTO.setTransformers(null);
    repoTO.setChunkerTO(createFixedChunkerTO());
    repoTO.setMultiChunker(createZipMultiChunkerTO());

    return new Config(new File("/dummy"), configTO, repoTO);
  }
View Full Code Here

    localConnectionSettings.put("path", localConnection.getPath().getAbsolutePath());

    configTO.setTransferSettings(connection);

    // Create
    Config config = new Config(tempLocalDir, configTO, repoTO);

    config.setConnection(connection);
    config.getAppDir().mkdirs();
    config.getCacheDir().mkdirs();
    config.getDatabaseDir().mkdirs();
    config.getLogDir().mkdirs();
    config.getStateDir().mkdirs();

    // Write to config folder (required for some tests)
    new Persister().write(configTO, new File(config.getAppDir() + "/" + Config.FILE_CONFIG));
    new Persister().write(repoTO, new File(config.getAppDir() + "/" + Config.FILE_REPO));

    return config;
  }
View Full Code Here

  public void testFileSystemActionReconDeleteNonExistingFolder() throws Exception {
    // Setup
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();
   
    TestClient clientA = new TestClient("A", testConnection);
    Config testConfigA = clientA.getConfig();
   
    // - Create first database version
    clientA.createNewFolder("new folder/some subfolder");
    clientA.upWithForceChecksum();
   
View Full Code Here

public class ChunkDaoTest {
  @Test
  public void testGetChunk() throws Exception {
    // Setup
    Config testConfig = TestConfigUtil.createTestLocalConfig();
    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set3.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
View Full Code Here

  }
 
  @Test
  public void testGetChunksForDatabaseVersion() throws Exception {
    // Setup
    Config testConfig = TestConfigUtil.createTestLocalConfig();
    Connection databaseConnection = testConfig.createDatabaseConnection();

    // Run
    TestSqlUtil.runSqlFromResource(databaseConnection, "test.insert.set1.sql");
   
    ChunkSqlDao chunkDao = new ChunkSqlDao(databaseConnection);
View Full Code Here

    repoTO.setMultiChunker(TestConfigUtil.createZipMultiChunkerTO()); // <<< valid
    repoTO.setRepoId(new byte[] { 0x01, 0x02 }); // <<< valid
    repoTO.setTransformers(null); // <<< valid   
   
    // Run!
    Config config = new Config(localDir, configTO, repoTO);
   
    // Test
    assertEquals("/some/folder/.syncany", config.getAppDir().getAbsolutePath());
    assertEquals("/some/folder/.syncany/cache", config.getCacheDir().getAbsolutePath());
    assertEquals("/some/folder/.syncany/db", config.getDatabaseDir().getAbsolutePath());
    assertEquals("/some/folder/.syncany/db/local.db", config.getDatabaseFile().getAbsolutePath());

    assertNotNull(config.getChunker());
    assertEquals("FixedChunker", config.getChunker().getClass().getSimpleName());
    assertEquals("SHA1", config.getChunker().getChecksumAlgorithm());
   
    assertNotNull(config.getMultiChunker());
    assertEquals("ZipMultiChunker", config.getMultiChunker().getClass().getSimpleName());

    assertNotNull(config.getTransformer());
    assertEquals("NoTransformer", config.getTransformer().getClass().getSimpleName());
   
    assertNotNull(config.getCache());
  }
View Full Code Here

  public void testConfigInitLocalDirNull() throws Exception {
    File localDir = null;
    ConfigTO configTO = new ConfigTO();
    RepoTO repoTO = new RepoTO();
   
    new Config(localDir, configTO, repoTO);     
  }
View Full Code Here

  public void testConfigInitConfigTONull() throws Exception {
    File localDir = new File("/some/folder");
    ConfigTO configTO = null;
    RepoTO repoTO = new RepoTO();
   
    new Config(localDir, configTO, repoTO);     
  }
View Full Code Here

  public void testConfigInitRepoTONull() throws Exception {
    File localDir = new File("/some/folder");
    ConfigTO configTO = new ConfigTO();
    RepoTO repoTO = null;
   
    new Config(localDir, configTO, repoTO);     
  }
View Full Code Here

TOP

Related Classes of org.syncany.config.Config

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.