public static void assertFileListEqualsExcludeLockedAndNoRead(File expectedFilesRoot, File actualFilesRoot) throws ArrayComparisonFailure, Exception { Map<String, File> expectedFiles = TestFileUtil.getLocalFilesExcludeLockedAndNoRead(expectedFilesRoot); Map<String, File> actualFiles = TestFileUtil.getLocalFilesExcludeLockedAndNoRead(actualFilesRoot); assertFileListEquals("File list does not match", expectedFiles, actualFiles); }
public static void assertXmlDatabaseFileEquals(File expectedDatabaseFile, File actualDatabaseFile, Transformer transformer) throws IOException { MemoryDatabase expectedDatabase = TestDatabaseUtil.readDatabaseFileFromDisk(expectedDatabaseFile, transformer); MemoryDatabase actualDatabase = TestDatabaseUtil.readDatabaseFileFromDisk(actualDatabaseFile, transformer); assertDatabaseEquals(expectedDatabase, actualDatabase); }
public File createFileWithContent(String name, String content) throws IOException { File localFile = getLocalFile(name); TestFileUtil.createFileWithContent(localFile, content); return localFile; }
public static File createRandomFileInDirectory(File rootFolder, long sizeInBytes) throws IOException { File newRandomFile = getRandomFilenameInDirectory(rootFolder); createRandomFile(newRandomFile, sizeInBytes); return newRandomFile; }
@BeforeClass public static void initialize() throws Exception { tempWatchRootAppFolder = TestFileUtil.createTempDirectoryInSystemTemp(WATCH_ROOT_APP_FOLDER); TestDaemonUtil.cleanUserConfig(); }
public void changeFile(String name) throws IOException { TestFileUtil.changeRandomPartOfBinaryFile(getLocalFile(name)); }
public static Map<String, File> getLocalFilesExcludeLockedAndNoRead(File root) throws FileNotFoundException { return getLocalFiles(root, new FileFilter() { @Override public boolean accept(File file) { return !FileUtil.isFileLocked(file) && canRead(file); } }); }
public File createNewFile(String name, long size) throws IOException { File localFile = getLocalFile(name); TestFileUtil.createNonRandomFile(localFile, size); return localFile; }
public File createNewFileInFolder(String name, String rootFolder, long size) throws IOException { File localFile = getLocalFileInFolder(name, rootFolder); TestFileUtil.createNonRandomFile(localFile, size); return localFile; }
@SomeAnnotation @AnotherAnnotation public void method2() { }
public void createNewFiles(String inFolder) throws IOException { TestFileUtil.createRandomFilesInDirectory(getLocalFile(inFolder), 25 * 1024, 20); }
public TestSqlDatabase loadLocalDatabase() throws IOException { return new TestSqlDatabase(config); } }
public PartialFileHistory getFileHistoryWithLastVersion(String relativePath) { return testDao.getFileHistoryWithLastVersion(relativePath); }
public static Config createTestLocalConfig() throws Exception { return createTestLocalConfig("syncanyclient"); }
public ConnectOperationResult connect(ConnectOperationOptions options) throws Exception { return connect(options, null); }
public static byte[] createRandomArray(int size) { return createArray(size, randomGen); }
@SomeAnnotation public void method1() { }
public InitOperationResult init(InitOperationOptions options) throws Exception { return init(options, null); }
public static Map<String, File> getLocalFiles(File root) throws FileNotFoundException { return getLocalFiles(root, null); }