use of org.eclipse.tycho.ArtifactDescriptor in project tycho by eclipse.
the class DefaultDependencyArtifactsTest method testMultiEnvironmentMetadataMerge.
@Test
public void testMultiEnvironmentMetadataMerge() {
ArtifactKey key = new DefaultArtifactKey("type", "id", "version");
File location = new File("location");
DefaultDependencyArtifacts tpA = new DefaultDependencyArtifacts();
tpA.addArtifactFile(key, location, asSet("a"));
DefaultDependencyArtifacts tpB = new DefaultDependencyArtifacts();
tpB.addArtifactFile(key, location, asSet("a", "b"));
MultiEnvironmentDependencyArtifacts tp = new MultiEnvironmentDependencyArtifacts();
tp.addPlatform(new TargetEnvironment("a", "a", "a"), tpA);
tp.addPlatform(new TargetEnvironment("b", "b", "b"), tpB);
List<ArtifactDescriptor> artifacts = tp.getArtifacts();
Assert.assertEquals(1, artifacts.size());
Set<Object> units = artifacts.get(0).getInstallableUnits();
Assert.assertEquals(2, units.size());
Assert.assertTrue(units.contains("a"));
Assert.assertTrue(units.contains("b"));
}
use of org.eclipse.tycho.ArtifactDescriptor in project tycho by eclipse.
the class LocalDependencyResolverTest method testBundleIdParsing.
public void testBundleIdParsing() throws Exception {
DependencyArtifacts platform = getTargetPlatform(new File("src/test/resources/targetplatforms/basic"));
ArtifactDescriptor artifact = platform.getArtifact(ArtifactType.TYPE_ECLIPSE_PLUGIN, "bundle01", null);
ArtifactKey key = artifact.getKey();
assertEquals("bundle01", key.getId());
assertEquals("0.0.1", key.getVersion());
File file = artifact.getLocation();
assertEquals("bundle01_0.0.1", file.getName());
}
use of org.eclipse.tycho.ArtifactDescriptor in project tycho by eclipse.
the class LocalDependencyResolverTest method testBundleRelativePath.
public void testBundleRelativePath() throws Exception {
File platformPath = new File("src/test/resources/targetplatforms/basic").getAbsoluteFile();
DependencyArtifacts platform = getTargetPlatform(platformPath);
File bundlePath = new File("src/test/resources/targetplatforms/basic/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar");
Map<String, ArtifactDescriptor> artifact = platform.getArtifact(bundlePath);
assertNotNull(artifact);
}
use of org.eclipse.tycho.ArtifactDescriptor in project tycho by eclipse.
the class LocalDependencyResolverTest method testPlatformRelativePath.
public void testPlatformRelativePath() throws Exception {
File platformPath = new File("src/test/resources/targetplatforms/basic");
DependencyArtifacts platform = getTargetPlatform(platformPath);
// absolute path to a bundle
File bundlePath = new File(platformPath, "plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar").getAbsoluteFile();
Map<String, ArtifactDescriptor> artifact = platform.getArtifact(bundlePath);
assertNotNull(artifact);
}
use of org.eclipse.tycho.ArtifactDescriptor in project tycho by eclipse.
the class TestMojo method getTestApplication.
private String getTestApplication(EquinoxInstallationDescription testRuntime) {
if (useUIHarness) {
ArtifactDescriptor systemBundle = testRuntime.getSystemBundle();
Version osgiVersion = Version.parseVersion(systemBundle.getKey().getVersion());
if (osgiVersion.compareTo(EquinoxInstallationDescription.EQUINOX_VERSION_3_3_0) < 0) {
return "org.eclipse.tycho.surefire.osgibooter.uitest32";
} else {
return "org.eclipse.tycho.surefire.osgibooter.uitest";
}
} else {
return "org.eclipse.tycho.surefire.osgibooter.headlesstest";
}
}
Aggregations