Package org.gradle.util

Examples of org.gradle.util.TestFile.file()


    @Test
    public void deletesExtraDirectoriesFromDestinationDirectoryAtTheEndOfVisit() {
        TestFile destDir = tmpDir.createDir("dest");
        destDir.file("included.txt").createFile();
        destDir.file("extra/extra.txt").createFile();

        visitor.startVisit(action(destDir));
        visitor.visitFile(file("included.txt"));
        visitor.endVisit();
View Full Code Here


        visitor.endVisit();

        TestFile expandDir = tmpDir.getDir().file("expanded");
        tarFile.untarTo(expandDir);
        expandDir.file("dir/file1").assertContents(equalTo("contents of dir/file1"));
        expandDir.file("file2").assertContents(equalTo("contents of file2"));
    }

    @Test
    public void wrapsFailureToOpenOutputFile() {
View Full Code Here

        visitor.endVisit();

        TestFile expandDir = tmpDir.getDir().file("expanded");
        tarFile.untarTo(expandDir);
        expandDir.file("dir/file1").assertContents(equalTo("contents of dir/file1"));
        expandDir.file("file2").assertContents(equalTo("contents of file2"));
    }

    @Test
    public void wrapsFailureToOpenOutputFile() {
        final TestFile tarFile = tmpDir.createDir("test.tar");
View Full Code Here

    }

    @Test
    public void doesNotDeleteDestDirectoryWhenNothingCopied() {
        TestFile destDir = tmpDir.createDir("dest");
        destDir.file("extra.txt").createFile();
        destDir.file("extra/extra.txt").createFile();

        visitor.startVisit(action(destDir));
        visitor.endVisit();
View Full Code Here

    @Test
    public void doesNotDeleteDestDirectoryWhenNothingCopied() {
        TestFile destDir = tmpDir.createDir("dest");
        destDir.file("extra.txt").createFile();
        destDir.file("extra/extra.txt").createFile();

        visitor.startVisit(action(destDir));
        visitor.endVisit();

        destDir.assertHasDescendants();
View Full Code Here

    }

    @Test
    public void didWorkWhenFilesDeleted() {
        TestFile destDir = tmpDir.createDir("dest");
        destDir.file("extra.txt").createFile();

        visitor.startVisit(action(destDir));
        visitor.endVisit();

        assertTrue(visitor.getDidWork());
View Full Code Here

            }
        });
        wrapper.execute();
        TestFile unjarDir = tmpDir.createDir("unjar");
        expectedTargetWrapperJar.unzipTo(unjarDir);
        unjarDir.file(GradleWrapperMain.class.getName().replace(".", "/") + ".class").assertIsFile();
        Properties properties = GUtil.loadProperties(expectedTargetWrapperProperties);
        assertEquals(properties.getProperty(Wrapper.URL_ROOT_PROPERTY), wrapper.getUrlRoot());
        assertEquals(properties.getProperty(Wrapper.DISTRIBUTION_BASE_PROPERTY), wrapper.getDistributionBase().toString());
        assertEquals(properties.getProperty(Wrapper.DISTRIBUTION_PATH_PROPERTY), wrapper.getDistributionPath());
        assertEquals(properties.getProperty(Wrapper.DISTRIBUTION_NAME_PROPERTY), wrapper.getArchiveName());
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.