Package org.junit.rules

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


  public static final boolean initOnce() throws IOException {
    if (once.compareAndSet(false, true)) {
      final TemporaryFolder tmpFolder = new TemporaryFolder();
      tmpFolder.create();
      init(tmpFolder.newFolder());

      // add shutdown hook because we want to initialized/cleanup once
      Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
        @Override
        public void run() {
View Full Code Here


        temp.newFile("hoge.txt");
        temp.newFile("photo1.jpg");
        temp.newFile("photo2.jpg");

        final File sub = temp.newFolder("sub");
        final File file1 = temp.newFile("photo3.jpg");
        final File file2 = temp.newFile("photo4.jpg");
        file1.renameTo(new File(sub.getAbsolutePath() + File.separator + file1.getName()));
        file2.renameTo(new File(sub.getAbsolutePath() + File.separator + file2.getName()));
        relativeNonExist = new File("./relative" + System.nanoTime() + ".txt");
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.