コード例 #1
0
  public File createDoNotUpdateList() {
    if (updateDoNotCopyOverContent.equals(""))
      for (String dirName : mainDirectories) addFilePathsToList(dirName);

    return FileUtil.createFile(
        new File(outputDirectory + "updateDoNotCopyOverList"), updateDoNotCopyOverContent);
  }
コード例 #2
0
 @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");
   }
 }
コード例 #3
0
  @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);
    }
  }
コード例 #4
0
 @Test
 public void createFileWithComplexPath() throws Exception {
   File file = FileUtil.createFile("temp/sub1/sub2/sub3/file", "");
   assertTrue(file.exists());
   FileUtil.deleteFileSystemDirectory("temp");
 }
コード例 #5
0
 private File createFileInDir(File dir, String fileName) {
   return FileUtil.createFile(FileUtil.buildPath(new String[] {dir.getPath(), fileName}), "");
 }
コード例 #6
0
  public File createUpdateList() {
    for (String dirName : mainDirectories) addFilePathsToList(dirName);

    return FileUtil.createFile(new File(outputDirectory + "updateList"), updateListContent);
  }
コード例 #7
0
 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", "");
 }