use of org.apache.ivy.Ivy in project ant-ivy by apache.
the class ResolveTest method testIVY151.
/**
* Test case for IVY-1151.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1151">IVY-1151</a>
*/
@Test
public void testIVY151() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/multirevisions/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/multirevisions/ivy.xml"), getResolveOptions(new String[] { "compile", "test" }));
assertNotNull(report);
assertNotNull(report.getUnresolvedDependencies());
assertEquals("Number of unresolved dependencies not correct", 0, report.getUnresolvedDependencies().length);
}
use of org.apache.ivy.Ivy in project ant-ivy by apache.
the class ResolveTest method testResolveModeDynamicWithBranch2.
@Test
public void testResolveModeDynamicWithBranch2() throws Exception {
// bar1;5 -> foo1#trunk|branch1;3|[0,4]
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/branches/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/branches/bar/bar1/trunk/6/ivy.xml"), getResolveOptions(new String[] { "*" }).setResolveMode(ResolveOptions.RESOLVEMODE_DYNAMIC));
assertFalse(report.hasError());
assertTrue(getArchiveFileInCache(ivy, "foo#foo1#branch1;4", "foo1", "jar", "jar").exists());
}
use of org.apache.ivy.Ivy in project ant-ivy by apache.
the class ResolveTest method testResolveTransitivelyToRelocatedPom.
@Test
public void testResolveTransitivelyToRelocatedPom() throws Exception {
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File("test/repositories/m2/org/relocated/testRelocationUser/1.0/" + "testRelocationUser-1.0.pom"), getResolveOptions(new String[] { "compile" }));
assertNotNull(report);
assertFalse(report.hasError());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0")).exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar", "jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0")).exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar").exists());
} finally {
ivy.popContext();
}
}
use of org.apache.ivy.Ivy in project ant-ivy by apache.
the class ResolveTest method testResolveNoRevisionNowhere.
/**
* Test case for IVY-258.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-258">IVY-258</a>
*/
@Test
public void testResolveNoRevisionNowhere() throws Exception {
// module1 depends on latest version of module2, which contains no revision in its ivy file,
// nor in the pattern
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/IVY-258/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/IVY-258/ivy.xml"), getResolveOptions(new String[] { "*" }));
assertFalse(report.hasError());
((BasicResolver) ivy.getSettings().getResolver("myresolver")).setCheckconsistency(false);
report = ivy.resolve(new File("test/repositories/IVY-258/ivy.xml"), getResolveOptions(new String[] { "*" }));
assertFalse(report.hasError());
}
use of org.apache.ivy.Ivy in project ant-ivy by apache.
the class ResolveTest method testBranches2.
@Test
public void testBranches2() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/branches/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/branches/bar/bar1/trunk/2/ivy.xml"), getResolveOptions(new String[] { "*" }).setValidate(false));
assertFalse(report.hasError());
assertTrue(getArchiveFileInCache(ivy, "foo#foo1#branch1;4", "foo1", "jar", "jar").exists());
}
Aggregations