Search in sources :

Example 1 with XmlSettingsParser

use of org.apache.ivy.core.settings.XmlSettingsParser in project ant-ivy by apache.

the class ChainResolverTest method testOrderFromConf.

@Test
public void testOrderFromConf() throws Exception {
    new XmlSettingsParser(settings).parse(ChainResolverTest.class.getResource("chainresolverconf.xml"));
    DependencyResolver resolver = settings.getResolver("chain");
    assertNotNull(resolver);
    assertTrue(resolver instanceof ChainResolver);
    ChainResolver chain = (ChainResolver) resolver;
    assertResolversSizeAndNames(chain, 3);
}
Also used : XmlSettingsParser(org.apache.ivy.core.settings.XmlSettingsParser) Test(org.junit.Test)

Example 2 with XmlSettingsParser

use of org.apache.ivy.core.settings.XmlSettingsParser in project ant-ivy by apache.

the class DualResolverTest method testFromConf.

@Test
public void testFromConf() throws Exception {
    new XmlSettingsParser(settings).parse(DualResolverTest.class.getResource("dualresolverconf.xml"));
    DependencyResolver resolver = settings.getResolver("dualok");
    assertNotNull(resolver);
    assertTrue(resolver instanceof DualResolver);
    DualResolver dual = (DualResolver) resolver;
    assertNotNull(dual.getIvyResolver());
    assertEquals("ivy", dual.getIvyResolver().getName());
    assertNotNull(dual.getArtifactResolver());
    assertEquals("artifact", dual.getArtifactResolver().getName());
    resolver = settings.getResolver("dualnotenough");
    assertNotNull(resolver);
    assertTrue(resolver instanceof DualResolver);
    dual = (DualResolver) resolver;
    assertNotNull(dual.getIvyResolver());
    assertNull(dual.getArtifactResolver());
}
Also used : XmlSettingsParser(org.apache.ivy.core.settings.XmlSettingsParser) Test(org.junit.Test)

Example 3 with XmlSettingsParser

use of org.apache.ivy.core.settings.XmlSettingsParser in project ant-ivy by apache.

the class MirroredURLResolverTest method setUp.

@Before
public void setUp() throws Exception {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
    settings.setVariable("test.mirroredurl.mirrorlist-solo.url", this.getClass().getResource("mirrorlist-solo.txt").toExternalForm());
    settings.setVariable("test.mirroredurl.mirrorlist-failover.url", this.getClass().getResource("mirrorlist-failover.txt").toExternalForm());
    settings.setVariable("test.mirroredurl.mirrorlist-fail.url", this.getClass().getResource("mirrorlist-fail.txt").toExternalForm());
    new XmlSettingsParser(settings).parse(MirroredURLResolverTest.class.getResource("mirror-resolver-settings.xml"));
}
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) XmlSettingsParser(org.apache.ivy.core.settings.XmlSettingsParser) Before(org.junit.Before)

Aggregations

XmlSettingsParser (org.apache.ivy.core.settings.XmlSettingsParser)3 Test (org.junit.Test)2 EventManager (org.apache.ivy.core.event.EventManager)1 ResolveData (org.apache.ivy.core.resolve.ResolveData)1 ResolveEngine (org.apache.ivy.core.resolve.ResolveEngine)1 ResolveOptions (org.apache.ivy.core.resolve.ResolveOptions)1 IvySettings (org.apache.ivy.core.settings.IvySettings)1 SortEngine (org.apache.ivy.core.sort.SortEngine)1 Before (org.junit.Before)1