Package org.apache.tools.ant

Examples of org.apache.tools.ant.Project


    private File repoCache;

    private File resolutionCache;

    protected void setUp() throws Exception {
        Project p = new Project();
        cacheDir = new File("build/cache");
        p.setProperty("cache", cacheDir.getAbsolutePath());
        cleanCache = new IvyCleanCache();
        cleanCache.setProject(p);
        IvyConfigure settings = new IvyConfigure();
        settings.setProject(p);
        settings.setUrl(IvyCleanCacheTest.class.getResource("ivysettings-cleancache.xml")
View Full Code Here


import org.apache.tools.ant.types.Reference;

public class IvyTaskTest extends TestCase {

    public void testDefaultSettings() throws MalformedURLException {
        Project p = new Project();
        p.setBasedir("test/repositories");
        p.setProperty("myproperty", "myvalue");
        IvyTask task = new IvyTask() {
            public void doExecute() throws BuildException {
            }
        };
        task.setProject(p);
View Full Code Here

                .getVariables().getVariable("ivy.settings.dir").toUpperCase());
        assertEquals("myvalue", settings.getVariables().getVariable("myproperty"));
    }

    public void testReferencedSettings() throws MalformedURLException {
        Project p = new Project();
        p.setProperty("myproperty", "myvalue");

        IvyAntSettings antSettings = new IvyAntSettings();
        antSettings.setProject(p);
        // antSettings.setId("mySettings");
        antSettings.setFile(new File("test/repositories/ivysettings.xml"));
        p.addReference("mySettings", antSettings);

        IvyTask task = new IvyTask() {
            public void doExecute() throws BuildException {
            }
        };
View Full Code Here

                .getVariable("ivy.settings.dir"));
        assertEquals("myvalue", settings.getVariables().getVariable("myproperty"));
    }

    public void testIvyVersionAsAntProperty() {
        Project p = new Project();
        p.setBasedir("test/repositories");
        IvyTask task = new IvyTask() {
            public void doExecute() throws BuildException {
            }
        };
        task.setProject(p);
        task.execute();

        assertNotNull(p.getProperty("ivy.version"));
    }
View Full Code Here

        settings.setDefaultCache(cache);
    }

    protected void tearDown() throws Exception {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here

    private Project project;

    protected void setUp() throws Exception {
        createCache();
        project = new Project();
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        prop = new IvyArtifactProperty();
        prop.setProject(project);
        System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
View Full Code Here

        cleanCache();
    }

    private void cleanCache() {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache);
        del.execute();
    }
View Full Code Here

    private Project project;

    protected void setUp() throws Exception {
        Message.setDefaultLogger(new DefaultMessageLogger(10));
        createCache();
        project = new Project();
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");

        task = new IvyPostResolveTask() {
            public void doExecute() throws BuildException {
                prepareAndCheck();
View Full Code Here

        newResolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple2.xml"));
        newResolve.setResolveId("testWithResolveId");
        newResolve.execute();

        // test the properties
        Project project = resolve.getProject();
        assertEquals("apache2", project.getProperty("ivy.organisation"));
        assertEquals("apache2", project.getProperty("ivy.organisation.testWithResolveId"));
        assertEquals("resolve-simple2", project.getProperty("ivy.module"));
        assertEquals("resolve-simple2", project.getProperty("ivy.module.testWithResolveId"));
        assertEquals("1.1", project.getProperty("ivy.revision"));
        assertEquals("1.1", project.getProperty("ivy.revision.testWithResolveId"));
        assertEquals("true", project.getProperty("ivy.deps.changed"));
        assertEquals("true", project.getProperty("ivy.deps.changed.testWithResolveId"));
        assertEquals("default", project.getProperty("ivy.resolved.configurations"));
        assertEquals("default",
            project.getProperty("ivy.resolved.configurations.testWithResolveId"));

        // test the references
        assertNotNull(project.getReference("ivy.resolved.report"));
        assertNotNull(project.getReference("ivy.resolved.report.testWithResolveId"));
        assertNotNull(project.getReference("ivy.resolved.descriptor"));
        assertNotNull(project.getReference("ivy.resolved.descriptor.testWithResolveId"));
        assertNotNull(project.getReference("ivy.resolved.configurations.ref"));
        assertNotNull(project.getReference("ivy.resolved.configurations.ref.testWithResolveId"));
    }
View Full Code Here

                .exists());
        assertFalse(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"))
                .exists());

        // test the properties
        Project project = resolve.getProject();
        assertFalse(project.getProperty("ivy.resolved.configurations").indexOf("default") > -1);
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.Project

Copyright © 2018 www.massapicom. 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.