예제 #1
0
  public void testCreateDir() {
    System.out.println("testCreateDir");
    String fs, dir, path_synarcher, path, path_test_kleinberg;

    fs = System.getProperty("file.separator");
    dir = System.getProperty("user.home") + fs;

    // creates ~/.synarcher/
    path_synarcher = dir + ".synarcher" + fs;
    path = path_synarcher + "test.txt";
    FileWriter.createDir(path);

    // creates ~/.synarcher/graphviz/
    path = path_synarcher + "graphviz" + fs + "test.txt";
    FileWriter.createDir(path);

    // creates ~/.synarcher/test_kleinberg/
    path_test_kleinberg = path_synarcher + "test_kleinberg" + fs;
    path = path_test_kleinberg + "test.txt";
    FileWriter.createDir(path);

    // creates ~/.synarcher/test_kleinberg/en/
    path_test_kleinberg = path_synarcher + "test_kleinberg" + fs;
    path = path_test_kleinberg + "en" + fs + "test.txt";
    FileWriter.createDir(path);

    // creates ~/.synarcher/test_kleinberg/ru/
    path_test_kleinberg = path_synarcher + "test_kleinberg" + fs;
    path = path_test_kleinberg + "ru" + fs + "test.txt";
    FileWriter.createDir(path);
  }
예제 #2
0
  /** Test of GetFilenameWoExt method, of class wikipedia.FileWriter. */
  public void testGetFilenameWoExt() {
    file.SetFilename("The_sample");
    assertEquals("The_sample", file.GetFilenameWoExt());

    file.SetFilename("The_sample.dot");
    assertEquals("The_sample", file.GetFilenameWoExt());

    file.SetFilename("The_sample.dot.funny.dot");
    assertEquals("The_sample.dot.funny", file.GetFilenameWoExt());

    file.SetFilename("Яблоко.dot");
    assertEquals("Яблоко", file.GetFilenameWoExt());
  }