use of org.apache.ivy.plugins.resolver.IBiblioResolver in project ant-ivy by apache.
the class IvyConfigureTest method testDefault.
@Test
public void testDefault() {
// by default settings look in the current directory for an ivysettings.xml file...
// but Ivy itself has one, and we don't want to use it
configure.getProject().setProperty("ivy.settings.file", "no/settings/will/use/default.xml");
configure.execute();
IvySettings settings = getIvyInstance().getSettings();
assertNotNull(settings.getDefaultResolver());
DependencyResolver publicResolver = settings.getResolver("public");
assertNotNull(publicResolver);
assertTrue(publicResolver instanceof IBiblioResolver);
IBiblioResolver ibiblio = (IBiblioResolver) publicResolver;
assertTrue(ibiblio.isM2compatible());
}
use of org.apache.ivy.plugins.resolver.IBiblioResolver in project ant-ivy by apache.
the class XmlSettingsParserTest method testMacroAndRef2.
/**
* Test case for IVY-860.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-860">IVY-860</a>
*/
@Test
public void testMacroAndRef2() throws Exception {
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-macro+ref2.xml"));
DependencyResolver macrores = settings.getResolver("macroresolver");
assertNotNull(macrores);
assertTrue(macrores instanceof ChainResolver);
DependencyResolver testResolver = settings.getResolver("test");
assertNotNull(testResolver);
assertTrue(testResolver instanceof IBiblioResolver);
ChainResolver chain = (ChainResolver) macrores;
List<DependencyResolver> subresolvers = chain.getResolvers();
assertNotNull(subresolvers);
assertEquals(1, subresolvers.size());
assertEquals(testResolver, subresolvers.get(0));
}
use of org.apache.ivy.plugins.resolver.IBiblioResolver in project ant-ivy by apache.
the class UpdateSiteAndIbiblioResolverTest method setUp.
@Before
public void setUp() throws Exception {
settings = new IvySettings();
chain = new ChainResolver();
chain.setName("chain");
chain.setSettings(settings);
resolver = new UpdateSiteResolver();
resolver.setName("ivyde-repo");
resolver.setUrl(new File("test/test-p2/ivyde-repo").toURI().toURL().toExternalForm());
resolver.setSettings(settings);
resolver2 = new IBiblioResolver();
resolver2.setName("maven2");
settings.setVariable("ivy.ibiblio.default.artifact.root", DEFAULT_M2_ROOT);
settings.setVariable("ivy.ibiblio.default.artifact.pattern", "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]");
resolver2.setSettings(settings);
chain.add(resolver);
chain.add(resolver2);
settings.addResolver(chain);
settings.setDefaultResolver("chain");
cache = new File("build/cache");
cache.mkdirs();
settings.setDefaultCache(cache);
ivy = new Ivy();
ivy.setSettings(settings);
ivy.bind();
ivy.getResolutionCacheManager().clean();
RepositoryCacheManager[] caches = settings.getRepositoryCacheManagers();
for (RepositoryCacheManager cache : caches) {
cache.clean();
}
data = new ResolveData(ivy.getResolveEngine(), new ResolveOptions());
}
use of org.apache.ivy.plugins.resolver.IBiblioResolver in project ant-ivy by apache.
the class SearchTest method testListInMavenRepo2.
@Test
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<String, Object> otherTokenValues = new HashMap<>();
otherTokenValues.put(IvyPatternHelper.ORGANISATION_KEY, "org.apache");
otherTokenValues.put(IvyPatternHelper.MODULE_KEY, "test-metadata");
String[] revs = ivy.listTokenValues(IvyPatternHelper.REVISION_KEY, otherTokenValues);
assertEquals(new HashSet<>(Arrays.asList("1.0", "1.1", "1.2")), new HashSet<>(Arrays.asList(revs)));
}
use of org.apache.ivy.plugins.resolver.IBiblioResolver in project ant-ivy by apache.
the class ConfigureTest method testDefault.
@Test
public void testDefault() throws ParseException, IOException {
Ivy ivy = new Ivy();
ivy.configureDefault();
IvySettings settings = ivy.getSettings();
assertNotNull(settings.getDefaultResolver());
DependencyResolver publicResolver = settings.getResolver("public");
assertNotNull(publicResolver);
assertTrue(publicResolver instanceof IBiblioResolver);
IBiblioResolver ibiblio = (IBiblioResolver) publicResolver;
assertTrue(ibiblio.isM2compatible());
}
Aggregations