Search in sources :

Example 6 with Location

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

the class TargetDefinitionResolverTest method testResolveOtherLocationYieldsWarning.

@Test
public void testResolveOtherLocationYieldsWarning() throws Exception {
    TargetDefinition definition = definitionWith(new OtherLocationStub(), new LocationStub(TARGET_FEATURE));
    TargetDefinitionContent units = subject.resolveContent(definition);
    assertThat(versionedIdsOf(units), hasItem(MAIN_BUNDLE));
    logVerifier.expectWarning("Target location type 'Directory' is not supported");
}
Also used : TargetDefinition(org.eclipse.tycho.p2.target.facade.TargetDefinition) Test(org.junit.Test)

Example 7 with Location

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

the class TargetDefinitionFileTest method testInvalidIncludeMode.

public void testInvalidIncludeMode() throws Exception {
    expectedException.expect(TargetDefinitionSyntaxException.class);
    List<? extends Location> locations = readTarget("invalidMode.target").getLocations();
    // allow exception to be thrown late
    InstallableUnitLocation invalidIncludeModeLocation = (InstallableUnitLocation) locations.get(0);
    invalidIncludeModeLocation.getIncludeMode();
}
Also used : InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation)

Example 8 with Location

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

the class TargetDefinitionFileTest method testTarget.

@Test
public void testTarget() throws Exception {
    List<? extends Location> locations = readTarget("target.target").getLocations();
    assertEquals(2, locations.size());
    InstallableUnitLocation location = (InstallableUnitLocation) locations.get(0);
    assertEquals(1, location.getRepositories().size());
    assertEquals(URI.create("http://download.eclipse.org/eclipse/updates/3.5/"), location.getRepositories().get(0).getLocation());
    assertEquals(1, location.getUnits().size());
    assertEquals("org.eclipse.platform.sdk", location.getUnits().get(0).getId());
    assertEquals("3.5.2.M20100211-1343", location.getUnits().get(0).getVersion());
    InstallableUnitLocation l02 = (InstallableUnitLocation) locations.get(1);
    assertEquals(5, l02.getUnits().size());
    assertEquals(2, l02.getRepositories().size());
    assertEquals(URI.create("http://subclipse.tigris.org/update_1.6.x/"), l02.getRepositories().get(0).getLocation());
    assertEquals(URI.create("http://download.eclipse.org/tools/mylyn/update/e3.4/"), l02.getRepositories().get(1).getLocation());
}
Also used : InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Test(org.junit.Test)

Example 9 with Location

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

the class TargetDefinitionFileTest method testDefaultIncludeModeValues.

@Test
public void testDefaultIncludeModeValues() throws Exception {
    List<? extends Location> locations = readTarget("includeModes.target").getLocations();
    InstallableUnitLocation locationWithDefaults = (InstallableUnitLocation) locations.get(0);
    assertEquals(IncludeMode.PLANNER, locationWithDefaults.getIncludeMode());
    assertEquals(false, locationWithDefaults.includeAllEnvironments());
}
Also used : InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Test(org.junit.Test)

Example 10 with Location

use of org.eclipse.tycho.p2.target.facade.TargetDefinition.Location 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)

Aggregations

Test (org.junit.Test)16 File (java.io.File)14 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)11 ArrayList (java.util.ArrayList)10 DefaultDependencyMetadataGenerator (org.eclipse.tycho.p2.impl.publisher.DefaultDependencyMetadataGenerator)8 ArtifactMock (org.eclipse.tycho.p2.impl.test.ArtifactMock)8 SourcesBundleDependencyMetadataGenerator (org.eclipse.tycho.p2.impl.publisher.SourcesBundleDependencyMetadataGenerator)7 DependencyMetadataGenerator (org.eclipse.tycho.p2.metadata.DependencyMetadataGenerator)7 InstallableUnitLocation (org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation)7 IRequirement (org.eclipse.equinox.p2.metadata.IRequirement)6 IRequiredCapability (org.eclipse.equinox.internal.p2.metadata.IRequiredCapability)4 TargetDefinition (org.eclipse.tycho.p2.target.facade.TargetDefinition)4 IOException (java.io.IOException)3 URI (java.net.URI)3 IArtifactDescriptor (org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor)3 TychoRepositoryIndex (org.eclipse.tycho.p2.repository.TychoRepositoryIndex)3 BufferedOutputStream (java.io.BufferedOutputStream)2 FileOutputStream (java.io.FileOutputStream)2 OutputStream (java.io.OutputStream)2 IArtifactKey (org.eclipse.equinox.p2.metadata.IArtifactKey)2