use of org.apache.ivy.plugins.resolver.DependencyResolver in project ant-ivy by apache.
the class ConfigureTest method testTypedefWithCustomClasspathWithFile.
@Test
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());
}
use of org.apache.ivy.plugins.resolver.DependencyResolver in project ant-ivy by apache.
the class IvySettingsTest method testChangeDefaultResolver.
@Test
public void testChangeDefaultResolver() throws ParseException, IOException {
Ivy ivy = new Ivy();
ivy.configureDefault();
IvySettings settings = ivy.getSettings();
DependencyResolver defaultResolver = settings.getDefaultResolver();
assertNotNull(defaultResolver);
assertEquals("default", defaultResolver.getName());
assertSame("default resolver cached", defaultResolver, settings.getDefaultResolver());
settings.setDefaultResolver("public");
DependencyResolver newDefault = settings.getDefaultResolver();
assertNotNull(newDefault);
assertNotSame("default resolver has changed", defaultResolver, newDefault);
assertEquals("resolver changed successfully", "public", newDefault.getName());
}
use of org.apache.ivy.plugins.resolver.DependencyResolver in project ant-ivy by apache.
the class OnlineXmlSettingsParserTest method testIncludeHttpRelativeUrl.
@Test
public void testIncludeHttpRelativeUrl() throws Exception {
// Use a settings file via http that use an include with relative url
configureURLHandler();
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(new URL("http://ant.apache.org/ivy/test/ivysettings-include-http-relative-url.xml"));
DependencyResolver resolver = settings.getResolver("ivyrep");
assertNotNull(resolver);
assertTrue(resolver instanceof IvyRepResolver);
}
use of org.apache.ivy.plugins.resolver.DependencyResolver in project ant-ivy by apache.
the class OnlineXmlSettingsParserTest method testIncludeHttpAbsoluteFile.
@Test
public void testIncludeHttpAbsoluteFile() throws Exception {
// Use a settings file via http that use an include with absolute file
// WARNING : this test will only work if the test are launched from the project root
// directory
configureURLHandler();
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(new URL("http://ant.apache.org/ivy/test/ivysettings-include-http-absolute-file.xml"));
DependencyResolver inc = settings.getResolver("includeworks");
assertNotNull(inc);
assertTrue(inc instanceof ChainResolver);
}
use of org.apache.ivy.plugins.resolver.DependencyResolver in project ant-ivy by apache.
the class OnlineXmlSettingsParserTest method testIncludeHttpRelativeFile.
@Test
public void testIncludeHttpRelativeFile() throws Exception {
// Use a settings file via http that use an include with relative file
configureURLHandler();
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(new URL("http://ant.apache.org/ivy/test/ivysettings-include-http-relative-file.xml"));
DependencyResolver resolver = settings.getResolver("ivyrep");
assertNotNull(resolver);
assertTrue(resolver instanceof IvyRepResolver);
}
Aggregations