Package org.apache.ivy

Examples of org.apache.ivy.Ivy.configure()


            new HashSet(Arrays.asList(revs)));
    }

    public void testListInMavenRepo2() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/m2/ivysettings.xml").toURI().toURL());
        ((IBiblioResolver) ivy.getSettings().getResolver("m2")).setUseMavenMetadata(false);

        Map otherTokenValues = new HashMap();
        otherTokenValues.put(IvyPatternHelper.ORGANISATION_KEY, "org.apache");
        otherTokenValues.put(IvyPatternHelper.MODULE_KEY, "test-metadata");
View Full Code Here


                Arrays.asList(revs)));
    }

    public void testListModulesWithExtraAttributes() throws ParseException, IOException {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/IVY-1128/ivysettings.xml"));
        IvySettings settings = ivy.getSettings();

        Map extendedAttributes = new HashMap();
        extendedAttributes.put("e:att1", "extraatt");
        extendedAttributes.put("e:att2", "extraatt2");
View Full Code Here

    public void testTypedefWithCustomClasspath() throws Exception {
        Ivy ivy = new Ivy();
        ivy.setVariable("ivy.custom.test.dir", new File("test/java/org/apache/ivy/core/settings")
                .toURI().toURL().toString());
        ivy.configure(ConfigureTest.class.getResource("ivysettings-custom-typedef.xml"));

        DependencyResolver custom = ivy.getSettings().getResolver("custom");
        assertNotNull(custom);
        assertEquals("org.apache.ivy.plugins.resolver.CustomResolver", custom.getClass().getName());
    }
View Full Code Here

    public void testTypedefWithCustomClasspathWithFile() throws Exception {
        Ivy ivy = new Ivy();
        ivy.setVariable("ivy.custom.test.dir",
            new File("test/java/org/apache/ivy/core/settings").getAbsolutePath());
        ivy.configure(ConfigureTest.class.getResource("ivysettings-custom-typedef2.xml"));

        DependencyResolver custom = ivy.getSettings().getResolver("custom");
        assertNotNull(custom);
        assertEquals("org.apache.ivy.plugins.resolver.CustomResolver", custom.getClass().getName());
    }
View Full Code Here

public class InstallTest extends TestCase {

    public void testSimple() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"), ivy.getSettings()
                .getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.2/ivy-2.0.xml").exists());
View Full Code Here

        assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
    }

    public void testValidate() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("orgfailure", "modfailure", "1.0"), ivy
                .getSettings().getDefaultResolver().getName(), "install", new InstallOptions());

        assertFalse(new File("build/test/install/orgfailure/modfailure/ivy-1.0.xml").exists());
View Full Code Here

                .exists());
    }

    public void testMaven() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ResolveReport rr = ivy.install(ModuleRevisionId.newInstance("org.apache", "test", "1.0"),
            ivy.getSettings().getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org.apache/test/ivy-1.0.xml").exists());
View Full Code Here

        assertTrue(new File("build/test/install/org.apache/test/test-1.0.pom").exists());
    }

    public void testNoValidate() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("orgfailure", "modfailure", "1.0"), ivy
                .getSettings().getDefaultResolver().getName(), "install",
            new InstallOptions().setValidate(false));
View Full Code Here

        assertTrue(new File("build/test/install/orgfailure/modfailure/modfailure-1.0.jar").exists());
    }

    public void testSimpleWithoutDefaultResolver() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings-nodefaultresolver.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0"), "test", "install",
            new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.2/ivy-2.0.xml").exists());
View Full Code Here

        assertTrue(new File("build/test/install/org1/mod1.2/mod1.2-2.0.jar").exists());
    }

    public void testDependencies() throws Exception {
        Ivy ivy = Ivy.newInstance();
        ivy.configure(new File("test/repositories/ivysettings.xml"));

        ivy.install(ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), ivy.getSettings()
                .getDefaultResolver().getName(), "install", new InstallOptions());

        assertTrue(new File("build/test/install/org1/mod1.1/ivy-1.0.xml").exists());
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.