Search in sources :

Example 26 with ResolveData

use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.

the class PomModuleDescriptorParserTest method testOverrideParentProperties.

@Test
public void testOverrideParentProperties() throws ParseException, IOException {
    settings.setDictatorResolver(new MockResolver() {

        public ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws ParseException {
            try {
                ModuleDescriptor moduleDescriptor = PomModuleDescriptorParser.getInstance().parseDescriptor(settings, getClass().getResource("test-version.pom"), false);
                return new ResolvedModuleRevision(null, null, moduleDescriptor, null);
            } catch (IOException e) {
                throw new AssertionError(e);
            }
        }
    });
    ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings, getClass().getResource("test-override-parent-properties.pom"), false);
    assertNotNull(md);
    assertEquals("1.0", md.getRevision());
    DependencyDescriptor[] dds = md.getDependencies();
    assertNotNull(dds);
    assertEquals(2, dds.length);
    // 2 are inherited from parent. Only the first one is important for this test
    assertEquals(ModuleRevisionId.newInstance("org.apache", "test-yet-other", "5.79"), dds[1].getDependencyRevisionId());
}
Also used : ResolveData(org.apache.ivy.core.resolve.ResolveData) DefaultModuleDescriptor(org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor) ModuleDescriptor(org.apache.ivy.core.module.descriptor.ModuleDescriptor) DependencyDescriptor(org.apache.ivy.core.module.descriptor.DependencyDescriptor) ResolvedModuleRevision(org.apache.ivy.core.resolve.ResolvedModuleRevision) MockResolver(org.apache.ivy.plugins.resolver.MockResolver) ParseException(java.text.ParseException) IOException(java.io.IOException) XmlModuleDescriptorParserTest(org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParserTest) Test(org.junit.Test)

Example 27 with ResolveData

use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.

the class ChainResolverTest method setUp.

@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    TestHelper.createCache();
    data = new ResolveData(engine, new ResolveOptions());
    settings.setDefaultCache(TestHelper.cache);
}
Also used : ResolveEngine(org.apache.ivy.core.resolve.ResolveEngine) SortEngine(org.apache.ivy.core.sort.SortEngine) ResolveData(org.apache.ivy.core.resolve.ResolveData) EventManager(org.apache.ivy.core.event.EventManager) IvySettings(org.apache.ivy.core.settings.IvySettings) ResolveOptions(org.apache.ivy.core.resolve.ResolveOptions) Before(org.junit.Before)

Example 28 with ResolveData

use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.

the class DualResolverTest method setUp.

@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);
}
Also used : ResolveEngine(org.apache.ivy.core.resolve.ResolveEngine) SortEngine(org.apache.ivy.core.sort.SortEngine) ResolveData(org.apache.ivy.core.resolve.ResolveData) EventManager(org.apache.ivy.core.event.EventManager) IvySettings(org.apache.ivy.core.settings.IvySettings) File(java.io.File) ResolveOptions(org.apache.ivy.core.resolve.ResolveOptions) Before(org.junit.Before)

Example 29 with ResolveData

use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.

the class IvyRepResolverTest method setUp.

@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
}
Also used : ResolveEngine(org.apache.ivy.core.resolve.ResolveEngine) SortEngine(org.apache.ivy.core.sort.SortEngine) ResolveData(org.apache.ivy.core.resolve.ResolveData) EventManager(org.apache.ivy.core.event.EventManager) IvySettings(org.apache.ivy.core.settings.IvySettings) ResolveOptions(org.apache.ivy.core.resolve.ResolveOptions) Before(org.junit.Before)

Example 30 with ResolveData

use of org.apache.ivy.core.resolve.ResolveData in project ant-ivy by apache.

the class BintrayResolverTest method setUp.

@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    settings.setDefaultCache(TestHelper.cache);
}
Also used : ResolveEngine(org.apache.ivy.core.resolve.ResolveEngine) SortEngine(org.apache.ivy.core.sort.SortEngine) ResolveData(org.apache.ivy.core.resolve.ResolveData) EventManager(org.apache.ivy.core.event.EventManager) IvySettings(org.apache.ivy.core.settings.IvySettings) ResolveOptions(org.apache.ivy.core.resolve.ResolveOptions) Before(org.junit.Before)

Aggregations

ResolveData (org.apache.ivy.core.resolve.ResolveData)33 ResolveOptions (org.apache.ivy.core.resolve.ResolveOptions)19 IvySettings (org.apache.ivy.core.settings.IvySettings)18 Before (org.junit.Before)16 ResolveEngine (org.apache.ivy.core.resolve.ResolveEngine)14 EventManager (org.apache.ivy.core.event.EventManager)13 SortEngine (org.apache.ivy.core.sort.SortEngine)13 DependencyDescriptor (org.apache.ivy.core.module.descriptor.DependencyDescriptor)11 ResolvedModuleRevision (org.apache.ivy.core.resolve.ResolvedModuleRevision)11 File (java.io.File)10 IOException (java.io.IOException)10 ParseException (java.text.ParseException)10 ModuleDescriptor (org.apache.ivy.core.module.descriptor.ModuleDescriptor)10 DefaultModuleDescriptor (org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor)9 XmlModuleDescriptorParserTest (org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParserTest)8 MockResolver (org.apache.ivy.plugins.resolver.MockResolver)8 Test (org.junit.Test)8 Ivy (org.apache.ivy.Ivy)5 RepositoryCacheManager (org.apache.ivy.core.cache.RepositoryCacheManager)5 ArrayList (java.util.ArrayList)2