Search in sources :

Example 1 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.

the class MirrorApplicationServiceTest method seedFor.

private static Collection<DependencySeed> seedFor(VersionedId... units) {
    Collection<DependencySeed> result = new ArrayList<>();
    for (VersionedId unit : units) {
        InstallableUnitDescription seedDescriptor = new InstallableUnitDescription();
        seedDescriptor.setId("iu-requiring." + unit.getId());
        seedDescriptor.addRequirements(strictRequirementTo(unit));
        result.add(DependencySeedUtil.createSeed(null, MetadataFactory.createInstallableUnit(seedDescriptor)));
    }
    return result;
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) InstallableUnitDescription(org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription) VersionedId(org.eclipse.equinox.p2.metadata.VersionedId) ArrayList(java.util.ArrayList)

Example 2 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.

the class MirrorApplicationServiceTest method testMirrorForSeedWithNullIU.

@Test
public void testMirrorForSeedWithNullIU() throws Exception {
    /*
         * While it is hard to get an IU from the target platform (cf. bug 412416, bug 372780), we
         * need to allow {@link DependencySeed} instances with null IU.
         */
    List<DependencySeed> seeds = Collections.singletonList(new DependencySeed(null, "org.eclipse.core.runtime", null));
    subject.mirrorReactor(sourceRepos("e342"), destinationRepo, seeds, context, false, false, null);
    assertTrue(repoFile(destinationRepo, "plugins/org.eclipse.core.runtime_3.4.0.v20080512.jar").exists());
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) Test(org.junit.Test)

Example 3 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.

the class PublishProductToolTest method testProductPublishingWithLaunchers.

@Test
public void testProductPublishingWithLaunchers() throws Exception {
    File productDefinition = resourceFile("publishers/products/test.product");
    File launcherBinaries = resourceFile("launchers/");
    subject = initPublisher();
    Collection<DependencySeed> seeds = subject.publishProduct(productDefinition, launcherBinaries, FLAVOR);
    assertThat(seeds.size(), is(1));
    DependencySeed seed = seeds.iterator().next();
    Set<Object> publishedUnits = outputRepository.getInstallableUnits();
    assertThat(publishedUnits, hasItem(seed.getInstallableUnit()));
    // test for launcher artifact
    Map<String, File> artifactLocations = outputRepository.getArtifactLocations();
    // TODO 348586 drop productUid from classifier
    String executableClassifier = "productUid.executable.testws.testos.testarch";
    assertThat(artifactLocations.keySet(), hasItem(executableClassifier));
    assertThat(artifactLocations.get(executableClassifier), isFile());
    assertThat(artifactLocations.get(executableClassifier).toString(), endsWith(".zip"));
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Matchers.anyString(org.mockito.Matchers.anyString) ResourceUtil.resourceFile(org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile) File(java.io.File) TychoMatchers.isFile(org.eclipse.tycho.test.util.TychoMatchers.isFile) Test(org.junit.Test)

Example 4 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.

the class PublishProductToolTest method testPublishingWithRootFeatures.

@Test
public void testPublishingWithRootFeatures() {
    File productDefinition = resourceFile("publishers/products/rootFeatures.product");
    subject = initPublisher(createFeatureIU("org.eclipse.rcp", "4.4.0.v20140128"), createFeatureIU("org.eclipse.e4.rcp", "1.0"), createFeatureIU("org.eclipse.help", "2.0.102.v20140128"), createFeatureIU("org.eclipse.egit", "2.0"));
    List<DependencySeed> seeds = subject.publishProduct(productDefinition, null, FLAVOR);
    IInstallableUnit productUnit = getUnique(productUnit(), unitsIn(seeds));
    assertThat(productUnit.getRequirements(), hasItem(requirement("org.eclipse.rcp.feature.group", "4.4.0.v20140128")));
    assertThat(productUnit.getRequirements(), hasItem(requirement("org.eclipse.e4.rcp.feature.group", "1.0")));
    assertThat(productUnit.getRequirements(), not(hasItem(requirement("org.eclipse.help.feature.group", "2.0.102.v20140128"))));
    assertThat(productUnit.getRequirements(), not(hasItem(requirement("org.eclipse.egit.feature.group", "2.0"))));
    assertThat(seeds.get(1).getId(), is("org.eclipse.help"));
    assertThat((IInstallableUnit) seeds.get(1).getInstallableUnit(), is(unitWithId("org.eclipse.help.feature.group")));
    assertThat(seeds.get(2).getId(), is("org.eclipse.egit"));
    assertThat((IInstallableUnit) seeds.get(2).getInstallableUnit(), is(unitWithId("org.eclipse.egit.feature.group")));
    assertThat(seeds, hasSize(3));
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) ResourceUtil.resourceFile(org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile) File(java.io.File) TychoMatchers.isFile(org.eclipse.tycho.test.util.TychoMatchers.isFile) Test(org.junit.Test)

Example 5 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed in project tycho by eclipse.

the class PublisherServiceTest method testCategoryPublishing.

@Test
public void testCategoryPublishing() throws Exception {
    File categoryDefinition = resourceFile("publishers/category.xml");
    Collection<DependencySeed> seeds = subject.publishCategories(categoryDefinition);
    assertThat(seeds.size(), is(1));
    DependencySeed seed = seeds.iterator().next();
    Set<Object> publishedUnits = outputRepository.getInstallableUnits();
    assertThat(publishedUnits, hasItem(seed.getInstallableUnit()));
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) ResourceUtil.resourceFile(org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile) File(java.io.File) Test(org.junit.Test)

Aggregations

DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)16 File (java.io.File)8 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)6 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)5 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 ResourceUtil.resourceFile (org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile)4 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)3 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 RepositoryReferences (org.eclipse.tycho.p2.tools.RepositoryReferences)2 PublisherService (org.eclipse.tycho.p2.tools.publisher.facade.PublisherService)2 TychoMatchers.isFile (org.eclipse.tycho.test.util.TychoMatchers.isFile)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 IProductDescriptor (org.eclipse.equinox.internal.p2.publisher.eclipse.IProductDescriptor)1 IProvidedCapability (org.eclipse.equinox.p2.metadata.IProvidedCapability)1 InstallableUnitDescription (org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription)1 Version (org.eclipse.equinox.p2.metadata.Version)1 VersionedId (org.eclipse.equinox.p2.metadata.VersionedId)1 IPublisherAdvice (org.eclipse.equinox.p2.publisher.IPublisherAdvice)1