use of org.eclipse.tycho.p2.impl.publisher.DefaultDependencyMetadataGenerator in project tycho by eclipse.
the class P2ResolverTestBase method prepare.
@Before
public final void prepare() throws Exception {
fullGenerator = new P2GeneratorImpl(true);
BuildPropertiesParserForTesting buildPropertiesReader = new BuildPropertiesParserForTesting();
fullGenerator.setBuildPropertiesParser(buildPropertiesReader);
dependencyGenerator = new DefaultDependencyMetadataGenerator();
dependencyGenerator.setBuildPropertiesParser(buildPropertiesReader);
tpConfig = new TargetPlatformConfigurationStub();
tpFactory = resolverFactory.getTargetPlatformFactoryImpl();
}
use of org.eclipse.tycho.p2.impl.publisher.DefaultDependencyMetadataGenerator in project tycho by eclipse.
the class P2GeneratorImplTest method testOptionalImportPackage_REQUIRE.
@Test
public void testOptionalImportPackage_REQUIRE() throws Exception {
DefaultDependencyMetadataGenerator generator = createDependencyMetadataGenerator();
File location = new File("resources/generator/optional-import-package").getCanonicalFile();
ArtifactMock artifactMock = new ArtifactMock(location, "optional-import-package", "optional-import-package", "0.0.1", "eclipse-plugin");
Set<Object> units = generator.generateMetadata(artifactMock, getEnvironments(), OptionalResolutionAction.REQUIRE).getMetadata();
assertEquals(1, units.size());
IInstallableUnit iu = getUnit("optional-import-package", units);
assertNotNull(iu);
List<IRequirement> requirements = new ArrayList<>(iu.getRequirements());
assertEquals(1, requirements.size());
IRequiredCapability requirement = (IRequiredCapability) requirements.get(0);
assertTrue(requirement.isGreedy());
assertEquals(1, requirement.getMin());
assertEquals(1, requirement.getMax());
assertEquals(PublisherHelper.CAPABILITY_NS_JAVA_PACKAGE, requirement.getNamespace());
assertEquals("org.osgi.framework", requirement.getName());
}
use of org.eclipse.tycho.p2.impl.publisher.DefaultDependencyMetadataGenerator in project tycho by eclipse.
the class P2GeneratorImplTest method createDependencyMetadataGenerator.
private DefaultDependencyMetadataGenerator createDependencyMetadataGenerator() {
DefaultDependencyMetadataGenerator generator = new DefaultDependencyMetadataGenerator();
generator.setBuildPropertiesParser(new BuildPropertiesParserForTesting());
return generator;
}
Aggregations