use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveMaven2GetSourcesWithSrcClassifier.
/**
* Test case for IVY-1138.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1138">IVY-1138</a>
*/
@Test
public void testResolveMaven2GetSourcesWithSrcClassifier() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-m2-with-src.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
assertFalse(report.hasError());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test-src", "1.0")).exists());
File jarFileInCache = getArchiveFileInCache(ivy, "org.apache", "test-src", "1.0", "test-src", "jar", "jar");
assertTrue(jarFileInCache.exists());
File sourceFileInCache = getArchiveFileInCache(ivy, "org.apache", "test-src", null, "1.0", "test-src", "source", "jar", Collections.singletonMap("classifier", "src"));
assertTrue(sourceFileInCache.exists());
assertTrue(jarFileInCache.length() != sourceFileInCache.length());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testLatestWhenReleased.
@Test
public void testLatestWhenReleased() throws Exception {
// The test verify that latest.integration dependencies can be resolved with released
// version also.
ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-latestreleased.xml"), getResolveOptions(new String[] { "default" }));
assertFalse(report.hasError());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org1", "mod_released", "1.1")).exists());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testExtraAttributesMultipleDependenciesNoHang.
@Test
public void testExtraAttributesMultipleDependenciesNoHang() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/extra-attributes-multipledependencies/ivysettings-filerepo-noattribs.xml"));
ivy.getSettings().setDefaultCache(cache);
ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-extra-att-multipledependencies.xml"), getResolveOptions(ivy.getSettings(), new String[] { "*" }).setValidate(false));
assertFalse(report.hasError());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveLatestWithNoRevisionInPattern.
@Test
public void testResolveLatestWithNoRevisionInPattern() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/norev/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/norev/ivy-latest.xml"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
assertFalse(report.hasError());
}
use of org.apache.ivy.core.report.ResolveReport in project ant-ivy by apache.
the class ResolveTest method testResolveMaven2ClassifiersWithoutPOM.
/**
* Test case for IVY-1041.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1041">IVY-1041</a>
*/
@Test
public void testResolveMaven2ClassifiersWithoutPOM() throws Exception {
// test-classifier depends on test-classified with classifier asl
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ResolveReport report = ivy.resolve(new File("test/repositories/m2/org/apache/test-classifier/2.0/test-classifier-2.0.pom"), getResolveOptions(new String[] { "*" }));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test-classifier", "2.0");
assertEquals(mrid, md.getModuleRevisionId());
assertTrue(getResolvedIvyFileInCache(mrid).exists());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test-classified", "2.0")).exists());
Map<String, String> cmap = new HashMap<>();
cmap.put("classifier", "asl");
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test-classified", /* branch */
null, "2.0", "test-classified", "jar", "jar", cmap).exists());
}
Aggregations