Search in sources :

Example 1 with TargetDefinition

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"))));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) Test(org.junit.Test)

Example 2 with TargetDefinition

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);
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 3 with TargetDefinition

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));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 4 with TargetDefinition

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));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 5 with TargetDefinition

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));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Aggregations

TargetDefinition (org.eclipse.tycho.p2.target.facade.TargetDefinition)31 Test (org.junit.Test)30 ArrayList (java.util.ArrayList)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 InstallableUnitLocation (org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation)2 Location (org.eclipse.tycho.p2.target.facade.TargetDefinition.Location)2 URI (java.net.URI)1 IMetadataRepository (org.eclipse.equinox.p2.repository.metadata.IMetadataRepository)1 Repository (org.eclipse.tycho.p2.target.facade.TargetDefinition.Repository)1