use of org.apache.ivy.core.module.descriptor.DependencyDescriptor in project ant-ivy by apache.
the class ResolveTest method testExtraAttributesForcedDependencies.
@Test
public void testExtraAttributesForcedDependencies() throws Exception {
Ivy ivy = new Ivy();
ivy.configure(new File("test/repositories/extra-attributes-forceddependencies/ivysettings-filerepo-attribs.xml"));
ivy.getSettings().setDefaultCache(cache);
ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-extra-attrib-forced-dependencies.xml"), getResolveOptions(ivy.getSettings(), new String[] { "*" }).setValidate(false));
assertFalse(report.hasError());
ivy.deliver("1.0.0", deliverDir.getAbsolutePath() + "/ivy-1.0.0.xml", new DeliverOptions().setResolveId(report.getResolveId()).setValidate(false).setPubdate(new Date()));
File deliveredIvyFile = new File(deliverDir, "ivy-1.0.0.xml");
assertTrue(deliveredIvyFile.exists());
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(ivy.getSettings(), deliveredIvyFile.toURI().toURL(), false);
DependencyDescriptor[] dds = md.getDependencies();
assertEquals(2, dds.length);
assertEquals(ModuleRevisionId.newInstance("CAE-Visualization-Components", "SGL", "MAIN", "6.2.34.7"), dds[1].getDependencyRevisionId());
}
use of org.apache.ivy.core.module.descriptor.DependencyDescriptor in project ant-ivy by apache.
the class ResolveTest method testIVY1159_orderIsModBModA.
/**
* Test case for IVY-1159.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1159">IVY-1159</a>
*/
@Test
public void testIVY1159_orderIsModBModA() throws Exception {
testIVY1159("ivy-depsorder_modB_then_modA.xml", false);
File deliveredIvyFile = new File("build/test/deliver/ivy-1.xml");
assertTrue(deliveredIvyFile.exists());
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(ivy.getSettings(), deliveredIvyFile.toURI().toURL(), false);
DependencyDescriptor[] dds = md.getDependencies();
assertEquals(2, dds.length);
assertEquals(ModuleRevisionId.newInstance("myorg", "modB", "0"), dds[0].getDependencyRevisionId());
assertEquals(ModuleRevisionId.newInstance("myorg", "modA", "0"), dds[1].getDependencyRevisionId());
}
use of org.apache.ivy.core.module.descriptor.DependencyDescriptor in project ant-ivy by apache.
the class ResolveTest method testIVY1159_orderIsModAModB.
/**
* Test case for IVY-1159.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1159">IVY-1159</a>
*/
@Test
public void testIVY1159_orderIsModAModB() throws Exception {
testIVY1159("ivy-depsorder_modA_then_modB.xml", false);
File deliveredIvyFile = new File("build/test/deliver/ivy-1.xml");
assertTrue(deliveredIvyFile.exists());
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(ivy.getSettings(), deliveredIvyFile.toURI().toURL(), false);
DependencyDescriptor[] dds = md.getDependencies();
assertEquals(2, dds.length);
assertEquals(ModuleRevisionId.newInstance("myorg", "modA", "0"), dds[0].getDependencyRevisionId());
assertEquals(ModuleRevisionId.newInstance("myorg", "modB", "0"), dds[1].getDependencyRevisionId());
}
use of org.apache.ivy.core.module.descriptor.DependencyDescriptor in project ant-ivy by apache.
the class ResolveTest method testIVY1159_orderIsModAModBReplaceForced.
/**
* Test case for IVY-1159.
*
* @throws Exception if something goes wrong
* @see <a href="https://issues.apache.org/jira/browse/IVY-1159">IVY-1159</a>
*/
@Test
public void testIVY1159_orderIsModAModBReplaceForced() throws Exception {
testIVY1159("ivy-depsorder_modA_then_modB.xml", true);
File deliveredIvyFile = new File("build/test/deliver/ivy-1.xml");
assertTrue(deliveredIvyFile.exists());
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(ivy.getSettings(), deliveredIvyFile.toURI().toURL(), false);
DependencyDescriptor[] dds = md.getDependencies();
assertEquals(2, dds.length);
assertEquals(ModuleRevisionId.newInstance("myorg", "modA", "1"), dds[0].getDependencyRevisionId());
assertEquals(ModuleRevisionId.newInstance("myorg", "modB", "1"), dds[1].getDependencyRevisionId());
}
use of org.apache.ivy.core.module.descriptor.DependencyDescriptor in project ant-ivy by apache.
the class SortTest method addDependency.
private DependencyDescriptor addDependency(DefaultModuleDescriptor parent, String moduleName, String revision) {
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org", moduleName, revision);
DependencyDescriptor depDescr = new DefaultDependencyDescriptor(parent, mrid, false, false, true);
parent.addDependency(depDescr);
return depDescr;
}
Aggregations