Search in sources :

Example 6 with BundleRepoDescriptor

use of org.apache.ivy.osgi.repo.BundleRepoDescriptor in project ant-ivy by apache.

the class BuildOBRTaskTest method testResolve.

@Test
public void testResolve() throws Exception {
    Project otherProject = TestHelper.newProject();
    otherProject.setProperty("ivy.settings.file", "test/test-repo/bundlerepo/ivysettings.xml");
    IvyResolve resolve = new IvyResolve();
    resolve.setProject(otherProject);
    resolve.setFile(new File("test/test-repo/ivy-test-buildobr.xml"));
    resolve.setResolveId("withResolveId");
    resolve.execute();
    File obrFile = new File("build/cache/obr.xml");
    buildObr.setProject(otherProject);
    buildObr.setResolveId("withResolveId");
    buildObr.setOut(obrFile);
    buildObr.execute();
    BundleRepoDescriptor obr = readObr(obrFile);
    assertEquals(1, CollectionUtils.toList(obr.getModules()).size());
}
Also used : Project(org.apache.tools.ant.Project) BundleRepoDescriptor(org.apache.ivy.osgi.repo.BundleRepoDescriptor) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)6 BundleRepoDescriptor (org.apache.ivy.osgi.repo.BundleRepoDescriptor)6 Test (org.junit.Test)6 FileInputStream (java.io.FileInputStream)3 ModuleDescriptorWrapper (org.apache.ivy.osgi.repo.ModuleDescriptorWrapper)2 FileOutputStream (java.io.FileOutputStream)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Artifact (org.apache.ivy.core.module.descriptor.Artifact)1 ModuleDescriptor (org.apache.ivy.core.module.descriptor.ModuleDescriptor)1 BundleArtifact (org.apache.ivy.osgi.core.BundleArtifact)1 BundleInfo (org.apache.ivy.osgi.core.BundleInfo)1 Project (org.apache.tools.ant.Project)1 ContentHandler (org.xml.sax.ContentHandler)1