Examples of file()


Examples of org.gradle.test.fixtures.file.TestFile.file()

    private void checkExecute() throws IOException {
        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(WrapperExecutor.DISTRIBUTION_URL_PROPERTY), wrapper.getDistributionUrl());
        assertEquals(properties.getProperty(WrapperExecutor.DISTRIBUTION_BASE_PROPERTY), wrapper.getDistributionBase().toString());
        assertEquals(properties.getProperty(WrapperExecutor.DISTRIBUTION_PATH_PROPERTY), wrapper.getDistributionPath());
        assertEquals(properties.getProperty(WrapperExecutor.ZIP_STORE_BASE_PROPERTY), wrapper.getArchiveBase().toString());
View Full Code Here

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

    @Test
    public void createsCacheForAFile() {
        final TestFile dir = tmpDir.createDir("otherDir");

        context.checking(new Expectations() {{
            one(cacheFactory).open(dir.file(".gradle", version, "a/b/c"), CacheUsage.ON, Collections.EMPTY_MAP);
            will(returnValue(cache));
        }});

        assertThat(repository.cache("a/b/c").forObject(dir).open(), sameInstance(cache));
    }
View Full Code Here

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

        TestFile dir = createCacheDir();

        DefaultPersistentDirectoryCache cache = new DefaultPersistentDirectoryCache(dir, CacheUsage.ON, properties);
        assertTrue(cache.isValid());

        dir.file("cache.properties").assertIsFile();
        dir.file("some-file").assertIsFile();
    }

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

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

        DefaultPersistentDirectoryCache cache = new DefaultPersistentDirectoryCache(dir, CacheUsage.ON, properties);
        assertTrue(cache.isValid());

        dir.file("cache.properties").assertIsFile();
        dir.file("some-file").assertIsFile();
    }

    @Test
    public void updateCreatesPropertiesFileWhenItDoesNotExist() {
        TestFile dir = tmpDir.getDir().file("dir");
View Full Code Here

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

        DefaultPersistentDirectoryCache cache = new DefaultPersistentDirectoryCache(dir, CacheUsage.ON, properties);
        cache.markValid();

        assertTrue(cache.isValid());
        assertThat(loadProperties(dir.file("cache.properties")), equalTo(properties));
    }

    @Test
    public void updatesPropertiesWhenMarkedValid() {
        TestFile dir = createCacheDir("prop", "some-other-value");
View Full Code Here

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

        DefaultPersistentDirectoryCache cache = new DefaultPersistentDirectoryCache(dir, CacheUsage.ON, properties);
        cache.markValid();

        assertTrue(cache.isValid());
        assertThat(loadProperties(dir.file("cache.properties")), equalTo(properties));
    }

    @Test
    public void createsAnIndexedCache() {
        TestFile dir = tmpDir.getDir().file("dir");
View Full Code Here

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

    private TestFile createCacheDir(String... extraProps) {
        TestFile dir = tmpDir.getDir();
        Properties properties = new Properties();
        properties.putAll(this.properties);
        properties.putAll(GUtil.map((Object[])extraProps));
        GUtil.saveProperties(properties, dir.file("cache.properties"));
        dir.file("some-file").touch();

        return dir;
    }
}
View Full Code Here

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

        TestFile dir = tmpDir.getDir();
        Properties properties = new Properties();
        properties.putAll(this.properties);
        properties.putAll(GUtil.map((Object[])extraProps));
        GUtil.saveProperties(properties, dir.file("cache.properties"));
        dir.file("some-file").touch();

        return dir;
    }
}
View Full Code Here

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

            "include 'child'",
            "project(':child').buildFileName = 'child.gradle'"
        );

        TestFile subDirectory = getTestDir().file("child");
        subDirectory.file("build.gradle").write("throw new RuntimeException()");
        subDirectory.file("child.gradle").write("task('do-stuff')");

        inDirectory(subDirectory).withSearchUpwards().withTasks("do-stuff").run();
        usingProjectDir(subDirectory).withSearchUpwards().withTasks("do-stuff").run();
    }
View Full Code Here

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

            "project(':child').buildFileName = 'child.gradle'"
        );

        TestFile subDirectory = getTestDir().file("child");
        subDirectory.file("build.gradle").write("throw new RuntimeException()");
        subDirectory.file("child.gradle").write("task('do-stuff')");

        inDirectory(subDirectory).withSearchUpwards().withTasks("do-stuff").run();
        usingProjectDir(subDirectory).withSearchUpwards().withTasks("do-stuff").run();
    }
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.