Package org.gradle.util

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


    private URI createJar() throws URISyntaxException {
        TestFile jarFile = tmpDir.getDir().file("test.jar");
        testDir.file("ignoreme").write("content");
        testDir.zipTo(jarFile);
        return new URI(String.format("jar:%s!/build.script", jarFile.toURI()));
    }

    @Test
    public void canConstructSourceFromFile() {
        UriScriptSource source = new UriScriptSource("<file-type>", scriptFile);
View Full Code Here


        propertiesFile.getParentFile().mkdirs();
        GUtil.saveProperties(props, propertiesFile);
        final ClassLoader classLoader = context.mock(ClassLoader.class, name);
        context.checking(new Expectations() {{
            allowing(classLoader).getResource("META-INF/gradle-plugins/" + id + ".properties");
            will(returnValue(propertiesFile.toURI().toURL()));
        }});
        return classLoader;
    }

    @Test
View Full Code Here

    @Test
    public void failsWhenNoImplementationClassSpecifiedInPropertiesFile() throws MalformedURLException {
        Properties properties = new Properties();
        final TestFile propertiesFile = testDir.file("prop");
        GUtil.saveProperties(properties, propertiesFile);
        final URL url = propertiesFile.toURI().toURL();

        context.checking(new Expectations() {{
            allowing(classLoader).getResource("META-INF/gradle-plugins/noImpl.properties");
            will(returnValue(url));
        }});
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.