use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverExecutionEnvironmentTest method testAutoGeneratedExecutionEnvironment.
@Test
public void testAutoGeneratedExecutionEnvironment() throws Exception {
subject = targetResolverForEE("JavaSE-1.7");
TargetDefinition definition = definitionWith(new AlternatePackageProviderLocationStub());
Collection<IInstallableUnit> units = subject.resolveContent(definition).getUnits();
// expect that resolver did not included a bundle providing org.w3c.dom...
assertThat(units, not(hasItem(unit("javax.xml", "0.0.1.SNAPSHOT"))));
// ... but instead included the configured 'a.jre' IU (which is not contained in the repository)
assertThat(units, hasItem(unit("a.jre.javase", "1.7.0")));
// other "a.jre" IUs from the repository shall be filtered out
assertThat(units, not(hasItem(unitWithId("a.jre"))));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeModeTest method testUnsatisfiedDependencyWithPlanner.
@Test(expected = ResolverException.class)
public void testUnsatisfiedDependencyWithPlanner() throws Exception {
// ignore logged errors
logVerifier.expectError(any(String.class));
TargetDefinition definition = definitionWith(new PlannerLocationStub(TestRepositories.UNSATISFIED, MAIN_BUNDLE));
subject.resolveContentWithExceptions(definition);
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testCanResolveBundlesWithoutSourcesWithSlicerMode.
@Test
public void testCanResolveBundlesWithoutSourcesWithSlicerMode() throws Exception {
TargetDefinition definition = definitionWith(new WithSourceLocationStub(IncludeMode.SLICER, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES, NOSOURCE_BUNDLE));
TargetDefinitionContent content = subject.resolveContentWithExceptions(definition);
assertThat(versionedIdsOf(content), hasItem(NOSOURCE_BUNDLE));
assertThat(versionedIdsOf(content), hasItem(BUNDLE_WITH_SOURCES));
assertThat(versionedIdsOf(content), hasItem(SOURCE_BUNDLE));
assertThat(content.getUnits().size(), is(3));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testNoSourceIncludeWhenIncludeSourceIsFalseWithSlicerMode.
@Test
public void testNoSourceIncludeWhenIncludeSourceIsFalseWithSlicerMode() throws Exception {
TargetDefinition definition = definitionWith(new WithoutSourceLocationStub(IncludeMode.SLICER, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES));
TargetDefinitionContent content = subject.resolveContentWithExceptions(definition);
assertThat(versionedIdsOf(content), not(hasItem(SOURCE_BUNDLE)));
assertThat(content.getUnits().size(), is(1));
}
use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.
the class TargetDefinitionResolverIncludeSourceTest method testNoSourceIncludeWhenIncludeSourceIsFalseWithPlannerMode.
@Test
public void testNoSourceIncludeWhenIncludeSourceIsFalseWithPlannerMode() throws Exception {
TargetDefinition definition = definitionWith(new WithoutSourceLocationStub(IncludeMode.PLANNER, TestRepositories.SOURCES, BUNDLE_WITH_SOURCES));
TargetDefinitionContent content = subject.resolveContentWithExceptions(definition);
assertThat(versionedIdsOf(content), not(hasItem(SOURCE_BUNDLE)));
assertThat(content.getUnits().size(), is(1));
}
Aggregations