Examples of newFile()


Examples of org.drools.core.util.FileManager.newFile()

        xml += "</change-set>";

        FileManager fileManager = new FileManager();
        fileManager.setUp();

        File fxml = fileManager.newFile( "changeset.xml" );
        Writer output = new BufferedWriter( new FileWriter( fxml ) );
        output.write( xml );
        output.close();

View Full Code Here

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

    @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

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

    @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

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

    public void createFiles() throws IOException {
        final TemporaryFolder temp = new TemporaryFolder();
        temp.create();
        root = temp.getRoot();

        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");
View Full Code Here

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

        final TemporaryFolder temp = new TemporaryFolder();
        temp.create();
        root = temp.getRoot();

        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");
View Full Code Here

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

        temp.create();
        root = temp.getRoot();

        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()));
View Full Code Here

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

        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

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

        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

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

    @Before
    public void createDirectory() throws IOException {
        final TemporaryFolder tempDir = createDir();
        final String[] dummyFiles = array("kafuka", "kaere", "kiri");
        for (final String name : dummyFiles) {
            tempDir.newFile(name);
        }
        dir = tempDir.getRoot();
        assertThat(dir.listFiles().length, is(dummyFiles.length));
    }
View Full Code Here

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

    // Make a new copy in a temporary file system so we don't overwrite our fixture
    String profilePath;

    try {
      Files.copy(resources.locate("profile/opera.ini"), temporaryProfile.newFile("operaprefs.ini"));
    } catch (IOException e) {
      fail("Unable to copy preference fixture: " + e.getMessage());
    }

    profilePath = temporaryProfile.getRoot().getAbsolutePath();
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.