Search in sources :

Example 11 with TargetDefinition

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

the class TargetDefinitionResolverTest method testResolveMultipleUnits.

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

Example 12 with TargetDefinition

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

the class TargetDefinitionResolverTest method testUnitOnlyLookedUpInLocation.

@Test(expected = TargetDefinitionResolutionException.class)
public void testUnitOnlyLookedUpInLocation() throws Exception {
    TargetDefinition definition = definitionWith(new LocationStub(TestRepositories.V2, MAIN_BUNDLE), new LocationStub(TestRepositories.V1));
    subject.resolveContentWithExceptions(definition);
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 13 with TargetDefinition

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

the class TargetDefinitionResolverTest method testUnitWithWildcardVersion.

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

Example 14 with TargetDefinition

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

the class TargetDefinitionResolverTest method testResolveIncludesDependencies.

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

Example 15 with TargetDefinition

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

the class TargetDefinitionResolverTest method testInvalidRepository.

@Test(expected = TargetDefinitionResolutionException.class)
public void testInvalidRepository() throws Exception {
    TargetDefinition definition = definitionWith(new LocationStub(TestRepositories.INVALID, 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