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();
}
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());
}
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());
}
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());
}
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());
}
Aggregations