use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class P2DependencyGeneratorImplTest method bundle_with_p2_inf.
@Test
public void bundle_with_p2_inf() throws Exception {
generateDependencies("bundle-p2-inf", PackagingType.TYPE_ECLIPSE_PLUGIN);
assertEquals(2, units.size());
IInstallableUnit unit = getUnitWithId("org.eclipse.tycho.p2.impl.test.bundle-p2-inf", units);
assertNotNull(unit);
assertEquals("1.0.0.qualifier", unit.getVersion().toString());
List<IRequirement> requirements = new ArrayList<>(unit.getRequirements());
assertEquals(1, requirements.size());
IRequiredCapability requirement = (IRequiredCapability) requirements.get(0);
assertEquals(IInstallableUnit.NAMESPACE_IU_ID, requirement.getNamespace());
assertEquals("required.p2.inf", requirement.getName());
assertNotNull(getUnitWithId("iu.p2.inf", units));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testExpandVersionsIgnoresBundlesInFeatureBasedProduct.
@Test
public void testExpandVersionsIgnoresBundlesInFeatureBasedProduct() throws Exception {
// product with useFeatures="true" and a non-resolvable plug-in reference -> the plug-in reference must be ignored (see bug 359090)
File productDefinition = resourceFile("publishers/products/featureProductWithLeftovers.product");
subject = initPublisher(createFeatureIU("org.eclipse.rcp", "3.3.101.R34x_v20081125"));
IInstallableUnit unit = getUnit(subject.publishProduct(productDefinition, null, FLAVOR));
assertThat(unit.getRequirements(), hasItem(strictRequirement("org.eclipse.rcp.feature.group", "3.3.101.R34x_v20081125")));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testPublishingWithProductSpecificP2Inf.
@Test
public void testPublishingWithProductSpecificP2Inf() {
File productDefinition = resourceFile("publishers/products/p2InfPerProduct/test.product");
subject = initPublisher();
IInstallableUnit unit = getUnit(subject.publishProduct(productDefinition, null, FLAVOR));
assertThat(unit.getRequirements(), hasItem(strictRequirement("extra.iu", "1.2.3." + QUALIFIER)));
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method initPublisher.
private PublishProductTool initPublisher(IInstallableUnit... tpUnits) {
LinkedHashSet<IInstallableUnit> contextUnits = new LinkedHashSet<>();
contextUnits.addAll(Arrays.asList(tpUnits));
P2TargetPlatform targetPlatform = new FinalTargetPlatformImpl(contextUnits, null, null, null, null, null);
PublisherActionRunner publisherRunner = new PublisherActionRunner(targetPlatform.getInstallableUnitsAsMetadataRepository(), ENVIRONMENTS, logVerifier.getLogger());
return new PublishProductToolImpl(publisherRunner, outputRepository, targetPlatform, QUALIFIER, interpolatorMock, logVerifier.getLogger());
}
use of org.eclipse.equinox.p2.metadata.IInstallableUnit in project tycho by eclipse.
the class PublishProductToolTest method testPublishingWithP2Inf.
@Test
public void testPublishingWithP2Inf() {
File productDefinition = resourceFile("publishers/products/p2Inf/test.product");
subject = initPublisher();
subject.publishProduct(productDefinition, null, FLAVOR);
assertThat(unitsIn(outputRepository), hasItem(unitWithId("testproduct")));
IInstallableUnit unit = getUnique(unitWithId("testproduct"), unitsIn(outputRepository));
assertThat(unit.getRequirements(), hasItem(strictRequirement("extra.iu", "1.2.3." + QUALIFIER)));
assertThat(unitsIn(outputRepository), hasItem(unitWithId("extra.iu")));
IInstallableUnit extraUnit = getUnique(unitWithId("extra.iu"), unitsIn(outputRepository));
assertThat(extraUnit.getVersion().toString(), is("1.2.3." + QUALIFIER));
assertThat(extraUnit, hasSelfCapability());
}
Aggregations