parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-macro.xml"));
DependencyResolver def = settings.getResolver("default");
assertNotNull(def);
assertTrue(def instanceof ChainResolver);
ChainResolver chain = (ChainResolver) def;
List subresolvers = chain.getResolvers();
assertNotNull(subresolvers);
assertEquals(2, subresolvers.size());
FileSystemResolver fsInt1 = (FileSystemResolver) subresolvers.get(0);
assertEquals("default-fs1", fsInt1.getName());
List ivyPatterns = fsInt1.getIvyPatterns();
assertNotNull(ivyPatterns);
assertEquals(1, ivyPatterns.size());
assertLocationEquals(
"path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
ivyPatterns.get(0));
FileSystemResolver fsInt2 = (FileSystemResolver) subresolvers.get(1);
assertEquals("default-fs2", fsInt2.getName());
ivyPatterns = fsInt2.getIvyPatterns();
assertNotNull(ivyPatterns);
assertEquals(1, ivyPatterns.size());
assertLocationEquals(
"path/to/secondrep/[organisation]/[module]/[type]s/ivy-[revision].xml",
ivyPatterns.get(0));
DependencyResolver other = settings.getResolver("other");
assertNotNull(other);
assertTrue(other instanceof ChainResolver);
chain = (ChainResolver) other;
subresolvers = chain.getResolvers();
assertNotNull(subresolvers);
assertEquals(2, subresolvers.size());
fsInt2 = (FileSystemResolver) subresolvers.get(1);
assertEquals("other-fs2", fsInt2.getName());