Package org.junit.rules

Examples of org.junit.rules.TemporaryFolder.create()


    return recover(logs, new HashSet<String>(), extent);
  }

  private static List<Mutation> recover(Map<String,KeyValue[]> logs, Set<String> files, KeyExtent extent) throws IOException {
    TemporaryFolder root = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
    root.create();
    final String workdir = root.getRoot().getAbsolutePath() + "/workdir";
    VolumeManager fs = VolumeManagerImpl.getLocal(workdir);
    final Path workdirPath = new Path("file://" + workdir);
    fs.deleteRecursively(workdirPath);
    ArrayList<Path> dirs = new ArrayList<Path>();
View Full Code Here


  }

  @Test
  public void recursiveDeleteFolderWithOneElement() throws IOException {
    TemporaryFolder folder= new TemporaryFolder();
    folder.create();
    File file= folder.newFile("a");
    folder.delete();
    assertFalse(file.exists());
    assertFalse(folder.getRoot().exists());
  }
View Full Code Here

  }

  @Test
  public void recursiveDeleteFolderWithOneRandomElement() throws IOException {
    TemporaryFolder folder= new TemporaryFolder();
    folder.create();
    File file= folder.newFile();
    folder.delete();
    assertFalse(file.exists());
    assertFalse(folder.getRoot().exists());
  }
View Full Code Here

  }

  @Test
  public void recursiveDeleteFolderWithZeroElements() throws IOException {
    TemporaryFolder folder= new TemporaryFolder();
    folder.create();
    folder.delete();
    assertFalse(folder.getRoot().exists());
  }

  private static final String GET_ROOT_DUMMY= "dummy-getRoot";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.