public File createDoNotUpdateList() { if (updateDoNotCopyOverContent.equals("")) for (String dirName : mainDirectories) addFilePathsToList(dirName); return FileUtil.createFile( new File(outputDirectory + "updateDoNotCopyOverList"), updateDoNotCopyOverContent); }
@Test public void testFileResponder() throws Exception { try { new File("testDir").mkdir(); new File("testDir/files").mkdir(); FileUtil.createFile("testDir/files/someFile", "this is a test"); request.setResource("files/someFile"); assertResponderType(FileResponder.class); } finally { FileUtil.deleteFileSystemDirectory("testDir"); } }
@Test public void systemPropertiesTakePrecedenceOverConfiguredProperties() throws Exception { final String configFileName = "systemPropertiesTakePrecedenceOverConfiguredProperties.properties"; FileUtil.createFile(configFileName, "Theme=example"); System.setProperty("Theme", "othertheme"); try { // Checked via logging: String output = runFitnesseMainWith("-o", "-c", "/root", "-f", configFileName); assertThat(output, containsString("othertheme")); } finally { System.getProperties().remove("Theme"); FileUtil.deleteFile(configFileName); } }
@Test public void createFileWithComplexPath() throws Exception { File file = FileUtil.createFile("temp/sub1/sub2/sub3/file", ""); assertTrue(file.exists()); FileUtil.deleteFileSystemDirectory("temp"); }
private File createFileInDir(File dir, String fileName) { return FileUtil.createFile(FileUtil.buildPath(new String[] {dir.getPath(), fileName}), ""); }
public File createUpdateList() { for (String dirName : mainDirectories) addFilePathsToList(dirName); return FileUtil.createFile(new File(outputDirectory + "updateList"), updateListContent); }
private void createMultiLevelDirectory() throws IOException { FileUtil.createFile("MasterFolder/MasterFile", ""); FileUtil.createFile("MasterFolder/TestFolder/TestFile", ""); FileUtil.createFile("MasterFolder/TestFolder/fitnesse.css", ""); FileUtil.createFile("MasterFolder/TestFolder/fitnesse_print.css", ""); }