use of org.apache.ivy.core.report.ResolveReport 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.core.report.ResolveReport 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.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveWithIncludeArtifactsTransitive.
/**
* Test case for IVY-541.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-541">IVY-541</a>
*/
@Test
public void testResolveWithIncludeArtifactsTransitive() throws Exception {
// mod2.6 depends on mod2.3 and mod2.1
// mod2.3 depends on mod2.1 and selects its artifacts
ResolveReport report = ivy.resolve(new File("test/repositories/1/org2/mod2.6/ivys/ivy-0.5.xml"), getResolveOptions(new String[] { "*" }));
assertFalse(report.hasError());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org2", "mod2.1", "0.3")).exists());
assertTrue(getArchiveFileInCache("org2", "mod2.1", "0.3", "art21A", "jar", "jar").exists());
assertTrue(getArchiveFileInCache("org2", "mod2.1", "0.3", "art21B", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport 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.core.report.ResolveReport 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());
}
Aggregations