use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveConflictsWithArtifacts.
/**
* Test case for IVY-537.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-537">IVY-537</a>
*/
@Test
public void testResolveConflictsWithArtifacts() throws Exception {
// #mod2.6;0.12 -> {#mod1.6;1.0.4 #mod2.5;0.6.2 }
// #mod1.6;1.0.4 -> #mod1.3;3.0 artifacts A and B
// #mod2.5;0.6.2 -> #mod1.3;3.1 artifact C
// #mod1.3;3.1 has only A and C artifacts, not B.
// Both A and C should be downloaded, and a message should tell that B was not available.
ResolveReport report = ivy.resolve(new File("test/repositories/1/org2/mod2.6/ivys/ivy-0.12.xml"), getResolveOptions(new String[] { "*" }));
assertFalse(report.hasError());
// dependencies
assertTrue(getArchiveFileInCache("org1", "mod1.3", "3.1", "mod1.3-A", "jar", "jar").exists());
assertTrue(getArchiveFileInCache("org1", "mod1.3", "3.1", "mod1.3-C", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveForceWithDynamicRevisionsAndSeveralConfs.
@Test
public void testResolveForceWithDynamicRevisionsAndSeveralConfs() throws Exception {
// mod4.1 v 4.6 (conf compile, runtime extends compile, test extends runtime) depends on
// - mod1.2 v 1+ and forces it in conf compile
// - mod3.1 v 1.2 in conf test which depends on mod1.2 v 2+
ResolveReport report = ivy.resolve(new File("test/repositories/2/mod4.1/ivy-4.6.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org4", "mod4.1", "4.6");
assertEquals(mrid, md.getModuleRevisionId());
assertTrue(getResolvedIvyFileInCache(mrid).exists());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org3", "mod3.1", "1.2")).exists());
assertTrue(getArchiveFileInCache("org3", "mod3.1", "1.2", "mod3.1", "jar", "jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "1.1")).exists());
assertTrue(getArchiveFileInCache("org1", "mod1.2", "1.1", "mod1.2", "jar", "jar").exists());
assertFalse(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "2.2")).exists());
assertFalse(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testIVY218.
/**
* Test case for IVY-218.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-218">IVY-218</a>
*/
@Test
public void testIVY218() throws Exception {
ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-218.xml"), getResolveOptions(new String[] { "test" }));
assertNotNull(report);
assertFalse(report.hasError());
assertEquals("Number of artifacts not correct", 3, report.getConfigurationReport("test").getArtifactsNumber());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveTransitiveExcludesSimple.
@Test
public void testResolveTransitiveExcludesSimple() throws Exception {
// mod2.5 depends on mod2.3 and excludes one artifact from mod2.1
// mod2.3 depends on mod2.1
ResolveReport report = ivy.resolve(new File("test/repositories/1/org2/mod2.5/ivys/ivy-0.6.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org2", "mod2.5", "0.6");
assertEquals(mrid, md.getModuleRevisionId());
assertTrue(getResolvedIvyFileInCache(mrid).exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org2", "mod2.3", "0.7")).exists());
assertTrue(getArchiveFileInCache("org2", "mod2.3", "0.7", "mod2.3", "jar", "jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org2", "mod2.1", "0.3")).exists());
assertTrue(getArchiveFileInCache("org2", "mod2.1", "0.3", "art21A", "jar", "jar").exists());
assertFalse(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 testResolveTransitivelyToPomRelocatedToNewVersion.
@Test
public void testResolveTransitivelyToPomRelocatedToNewVersion() 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.1/" + "testRelocationUser-1.1.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();
}
}
Aggregations