use of org.apache.ivy.plugins.version.MockVersionMatcher in project ant-ivy by apache.
the class XmlSettingsParserTest method testVersionMatchers2.
@Test
public void testVersionMatchers2() throws Exception {
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-vmatcher2.xml"));
VersionMatcher mock = settings.getVersionMatcher("vmock");
assertNotNull(mock);
assertTrue(mock instanceof MockVersionMatcher);
VersionMatcher v = settings.getVersionMatcher();
assertTrue(v instanceof ChainVersionMatcher);
ChainVersionMatcher chain = (ChainVersionMatcher) v;
assertEquals(5, chain.getMatchers().size());
assertTrue(chain.getMatchers().contains(mock));
}
use of org.apache.ivy.plugins.version.MockVersionMatcher in project ant-ivy by apache.
the class XmlSettingsParserTest method testVersionMatchers1.
@Test
public void testVersionMatchers1() throws Exception {
IvySettings settings = new IvySettings();
XmlSettingsParser parser = new XmlSettingsParser(settings);
parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-vmatcher1.xml"));
VersionMatcher mock = settings.getVersionMatcher("vmock");
assertNotNull(mock);
assertTrue(mock instanceof MockVersionMatcher);
VersionMatcher v = settings.getVersionMatcher();
assertTrue(v instanceof ChainVersionMatcher);
ChainVersionMatcher chain = (ChainVersionMatcher) v;
assertEquals(3, chain.getMatchers().size());
assertTrue(chain.getMatchers().contains(mock));
assertTrue(chain.getMatchers().contains(settings.getVersionMatcher("exact")));
assertTrue(chain.getMatchers().contains(settings.getVersionMatcher("latest")));
}
Aggregations