Search in sources :

Example 21 with TargetDefinition

use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.

the class TargetDefinitionResolverTest method testResolveNoLocations.

@Test
public void testResolveNoLocations() throws Exception {
    TargetDefinition definition = definitionWith();
    TargetDefinitionContent units = subject.resolveContent(definition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList()));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 22 with TargetDefinition

use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.

the class TargetDefinitionResolverTest method testResolveWithBundleInclusionListYieldsWarning.

@Test
public void testResolveWithBundleInclusionListYieldsWarning() {
    List<Location> noLocations = Collections.emptyList();
    TargetDefinition definition = new TargetDefinitionStub(noLocations, true);
    subject.resolveContent(definition);
    // this was bug 373776: the includeBundles tag (which is the selection on the Content tab) was silently ignored
    logVerifier.expectWarning("De-selecting bundles in a target definition file is not supported");
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Location(org.eclipse.tycho.p2.target.facade.TargetDefinition.Location) Test(org.junit.Test)

Example 23 with TargetDefinition

use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.

the class TargetDefinitionResolverTest method testUnitWithExactVersion.

@Test
public void testUnitWithExactVersion() {
    TargetDefinition definition = definitionWith(new LocationStub(TestRepositories.V1_AND_V2, REFERENCED_BUNDLE_V1));
    TargetDefinitionContent units = subject.resolveContent(definition);
    assertThat(versionedIdsOf(units), bagEquals(versionedIdList(REFERENCED_BUNDLE_V1)));
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 24 with TargetDefinition

use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.

the class TargetDefinitionResolverExecutionEnvironmentTest method testRestrictedExecutionEnvironment.

@Test
public void testRestrictedExecutionEnvironment() throws Exception {
    subject = targetResolverForEE("CDC-1.0/Foundation-1.0");
    TargetDefinition definition = definitionWith(new AlternatePackageProviderLocationStub());
    Collection<IInstallableUnit> units = subject.resolveContent(definition).getUnits();
    // expect that resolver included a bundle providing org.w3c.dom (here javax.xml)...
    assertThat(units, hasItem(unit("javax.xml", "0.0.1.SNAPSHOT")));
    // ... and did not match the import against the "a.jre" IU also in the repository
    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 25 with TargetDefinition

use of org.eclipse.tycho.p2.target.facade.TargetDefinition in project tycho by eclipse.

the class TargetDefinitionResolverIncludeModeTest method testUnsatisfiedInclusionWithSlicerFails.

@Test(expected = ResolverException.class)
public void testUnsatisfiedInclusionWithSlicerFails() throws Exception {
    TargetDefinition definition = definitionWith(new SlicerLocationStub(TestRepositories.UNSATISFIED, TARGET_FEATURE));
    subject.resolveContentWithExceptions(definition);
}
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