use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveSimple.
@Test
public void testResolveSimple() throws Exception {
// mod1.1 depends on mod1.2
ResolveReport report = ivy.resolve(new File("test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
assertTrue(getResolvedIvyFileInCache(mrid).exists());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.2", "2.0")).exists());
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveSeveralDefaultWithArtifactsAndConfs2.
/**
* Second test case for IVY-283.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-283">IVY-283</a>
*/
@Test
public void testResolveSeveralDefaultWithArtifactsAndConfs2() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/IVY-283/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/IVY-283/ivy-d.xml"), getResolveOptions(new String[] { "*" }));
assertFalse(report.hasError());
// dependencies
ConfigurationResolveReport crr = report.getConfigurationReport("build");
assertNotNull(crr);
assertEquals(9, crr.getDownloadReports(ModuleRevisionId.newInstance("medicel", "module_a", "local")).length);
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_a", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_b", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_c", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_d", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_e", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_f", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_g", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_h", "jar", "jar").exists());
assertTrue(getArchiveFileInCache(ivy, "medicel", "module_a", "local", "lib_a_i", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveExcludesConf2.
@Test
public void testResolveExcludesConf2() throws Exception {
// same as testResolveExcludesConf
ResolveReport report = ivy.resolve(new File("test/repositories/1/org2/mod2.6/ivys/ivy-0.13.xml"), getResolveOptions(new String[] { "exclude" }));
ModuleDescriptor md = report.getModuleDescriptor();
assertEquals(ModuleRevisionId.newInstance("org2", "mod2.6", "0.13"), md.getModuleRevisionId());
assertFalse(getIvyFileInCache(ModuleRevisionId.newInstance("org2", "mod2.3", "0.4")).exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveWithStartPublicConf.
@Test
public void testResolveWithStartPublicConf() throws Exception {
// mod2.2 depends on mod1.3 and selects its artifacts
ResolveReport report = ivy.resolve(new File("test/repositories/1/org2/mod2.2/ivys/ivy-0.8.xml"), getResolveOptions(new String[] { "*(public)" }));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org2", "mod2.2", "0.8");
assertEquals(mrid, md.getModuleRevisionId());
assertTrue(getResolvedIvyFileInCache(mrid).exists());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod1.3", "3.0")).exists());
assertTrue(getArchiveFileInCache("org1", "mod1.3", "3.0", "mod1.3-A", "jar", "jar").exists());
assertTrue(getArchiveFileInCache("org1", "mod1.3", "3.0", "mod1.3-B", "jar", "jar").exists());
assertFalse(getArchiveFileInCache("org1", "mod1.3", "3.0", "mod1.3", "jar", "jar").exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testIVY1236.
/**
* Test case for IVY-1236.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1236">IVY-1236</a>
*/
@Test
public void testIVY1236() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/IVY-1236/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/IVY-1236/ivy.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
assertNotNull(report.getUnresolvedDependencies());
assertEquals("Number of unresolved dependencies not correct", 0, report.getUnresolvedDependencies().length);
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("myorg", "modB", "1.0")).exists());
assertTrue(getArchiveFileInCache("myorg", "modB", "1.0", "modB", "jar", "jar").exists());
assertTrue(getArchiveFileInCache("myorg", "modB", "1.0", "modB-A", "jar", "jar").exists());
}
Aggregations