Search in sources :

Example 1 with InstallableUnitLocation

use of org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation 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 2 with InstallableUnitLocation

use of org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation 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 3 with InstallableUnitLocation

use of org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation 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 4 with InstallableUnitLocation

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

the class TargetDefinitionFileTest method testExplictIncludeModeValues.

@Test
public void testExplictIncludeModeValues() throws Exception {
    List<? extends Location> locations = readTarget("includeModes.target").getLocations();
    InstallableUnitLocation locationWithPlanner = (InstallableUnitLocation) locations.get(1);
    InstallableUnitLocation locationWithSlicer = (InstallableUnitLocation) locations.get(2);
    InstallableUnitLocation locationWithSlicerAndAllEnvironments = (InstallableUnitLocation) locations.get(3);
    assertEquals(IncludeMode.PLANNER, locationWithPlanner.getIncludeMode());
    assertEquals(IncludeMode.SLICER, locationWithSlicer.getIncludeMode());
    assertEquals(false, locationWithSlicer.includeAllEnvironments());
    assertEquals(IncludeMode.SLICER, locationWithSlicerAndAllEnvironments.getIncludeMode());
    assertEquals(true, locationWithSlicerAndAllEnvironments.includeAllEnvironments());
}
Also used : InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Test(org.junit.Test)

Example 5 with InstallableUnitLocation

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

the class TargetDefinitionFileTest method testIncludeSource.

@Test
public void testIncludeSource() throws Exception {
    List<? extends Location> locations = readTarget("includeSource.target", IncludeSourceMode.honor).getLocations();
    InstallableUnitLocation locationWithSources = (InstallableUnitLocation) locations.get(0);
    InstallableUnitLocation locationWithoutSources = (InstallableUnitLocation) locations.get(1);
    InstallableUnitLocation locationWithoutIncludeSourceAttribute = (InstallableUnitLocation) locations.get(2);
    assertEquals(true, locationWithSources.includeSource());
    assertEquals(false, locationWithoutSources.includeSource());
    assertEquals(false, locationWithoutIncludeSourceAttribute.includeSource());
}
Also used : InstallableUnitLocation(org.eclipse.tycho.p2.target.facade.TargetDefinition.InstallableUnitLocation) Test(org.junit.Test)

Aggregations

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