public static Config createTestLocalConfig() throws Exception { return createTestLocalConfig("syncanyclient"); }
public static Config createTestLocalConfig(String machineName) throws Exception { return createTestLocalConfig(machineName, createTestLocalConnection()); }
public TestClient(String machineName, TransferSettings connection) throws Exception { Config testConfig = TestConfigUtil.createTestLocalConfig(machineName, connection); testConfig.setMachineName(machineName); testConfig.setDisplayName(machineName); config = testConfig; }
@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); }
@Test public void testConfigHelperFindLocalDirInPath() throws Exception { // Setup Config testConfig = TestConfigUtil.createTestLocalConfig(); File startingPath = testConfig.getLocalDir(); // Run File actualLocalDir = ConfigHelper.findLocalDirInPath(startingPath); // Test assertNotNull(actualLocalDir); assertEquals(testConfig.getLocalDir(), actualLocalDir.getCanonicalFile()); // Tear down TestConfigUtil.deleteTestLocalConfigAndData(testConfig); }
@Test public void testConfigHelperLoadConfigTO() throws Exception { // Setup Config testConfig = TestConfigUtil.createTestLocalConfig(); // Run ConfigTO loadedConfigTO = ConfigHelper.loadConfigTO(testConfig.getLocalDir()); // Test assertNotNull(loadedConfigTO); assertEquals(testConfig.getDisplayName(), loadedConfigTO.getDisplayName()); assertEquals(testConfig.getMachineName(), loadedConfigTO.getMachineName()); assertEquals(testConfig.getMasterKey(), loadedConfigTO.getMasterKey()); // Tear down TestConfigUtil.deleteTestLocalConfigAndData(testConfig); }
@Test public void testConfigHelperLoadRepoTO() throws Exception { Config testConfig = TestConfigUtil.createTestLocalConfig();
@Test public void testConfigHelperLoadConfig() throws Exception { // Setup Config testConfig = TestConfigUtil.createTestLocalConfig(); // Run Config loadedConfig = ConfigHelper.loadConfig(testConfig.getLocalDir()); // Test assertNotNull(loadedConfig); assertEquals(testConfig.getAppDir(), loadedConfig.getAppDir()); assertEquals(testConfig.getCacheDir(), loadedConfig.getCacheDir()); assertNotNull(loadedConfig.getChunker()); assertEquals(testConfig.getChunker().toString(), loadedConfig.getChunker().toString()); assertNotNull(loadedConfig.getCache()); assertNotNull(loadedConfig.getConnection()); assertEquals(testConfig.getDatabaseDir(), loadedConfig.getDatabaseDir()); assertEquals(testConfig.getDatabaseFile(), loadedConfig.getDatabaseFile()); assertEquals(testConfig.getDisplayName(), loadedConfig.getDisplayName()); assertEquals(testConfig.getLocalDir(), loadedConfig.getLocalDir()); assertEquals(testConfig.getLogDir(), loadedConfig.getLogDir()); assertEquals(testConfig.getMachineName(), loadedConfig.getMachineName()); assertEquals(testConfig.getMasterKey(), loadedConfig.getMasterKey()); assertNotNull(loadedConfig.getMultiChunker()); assertNotNull(loadedConfig.getRepoId()); assertNotNull(loadedConfig.getTransformer()); // Tear down TestConfigUtil.deleteTestLocalConfigAndData(testConfig); }