Ejemplo n.º 1
0
  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");
   }
 }
Ejemplo n.º 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);
    }
  }
Ejemplo n.º 4
0
 @Test
 public void createFileWithComplexPath() throws Exception {
   File file = FileUtil.createFile("temp/sub1/sub2/sub3/file", "");
   assertTrue(file.exists());
   FileUtil.deleteFileSystemDirectory("temp");
 }
Ejemplo n.º 5
0
 private File createFileInDir(File dir, String fileName) {
   return FileUtil.createFile(FileUtil.buildPath(new String[] {dir.getPath(), fileName}), "");
 }
Ejemplo n.º 6
0
  public File createUpdateList() {
    for (String dirName : mainDirectories) addFilePathsToList(dirName);

    return FileUtil.createFile(new File(outputDirectory + "updateList"), updateListContent);
  }
Ejemplo n.º 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", "");
 }