use of org.eclipse.tycho.core.ee.CustomExecutionEnvironment in project tycho by eclipse.
the class DependencyComputerTest method testWiringToPackageFromCustomProfile.
// TODO code reuse
@Test
public void testWiringToPackageFromCustomProfile() throws Exception {
File basedir = getBasedir("projects/customProfile");
Map<File, MavenProject> basedirMap = MavenSessionUtils.getBasedirMap(getSortedProjects(basedir, null));
MavenProject project = basedirMap.get(new File(basedir, "bundle"));
DependencyArtifacts platform = (DependencyArtifacts) project.getContextValue(TychoConstants.CTX_DEPENDENCY_ARTIFACTS);
CustomExecutionEnvironment customProfile = new CustomExecutionEnvironment("custom", Arrays.asList(//
new SystemCapability(Type.JAVA_PACKAGE, "package.historically.not.in.jdk", "1.2.1"), //
new SystemCapability(Type.OSGI_EE, "OSGi/Minimum", "1.0.0"), //
new SystemCapability(Type.OSGI_EE, "JavaSE", "1.0.0"), //
new SystemCapability(Type.OSGI_EE, "JavaSE", "1.1.0"), new SystemCapability(Type.OSGI_EE, "JavaSE", "1.2.0")));
State state = resolver.newResolvedState(project, customProfile, false, platform);
BundleDescription bundle = state.getBundleByLocation(project.getBasedir().getAbsolutePath());
List<DependencyEntry> dependencies = dependencyComputer.computeDependencies(state.getStateHelper(), bundle);
if (dependencies.size() > 0) {
assertThat(dependencies.size(), is(1));
assertThat(dependencies.get(0).desc.getSymbolicName(), is(Constants.SYSTEM_BUNDLE_SYMBOLICNAME));
}
}
Aggregations