Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2020-06-29 19:11:33 +0000
committerAlex Blewitt2020-07-01 21:14:53 +0000
commit98a3f806ae5fe6d2dd41350e1b8e1739da77021b (patch)
treefb6bc9a61f140ddc8d3fa7d97f3660125ac9956c
parenta8dc2a68c52f3dab4a730c9769d632bcef6f8a14 (diff)
downloadrt.equinox.p2-98a3f806ae5fe6d2dd41350e1b8e1739da77021b.tar.gz
rt.equinox.p2-98a3f806ae5fe6d2dd41350e1b8e1739da77021b.tar.xz
rt.equinox.p2-98a3f806ae5fe6d2dd41350e1b8e1739da77021b.zip
Bug 564749 - AbstractReconcilerTest does not work on macOS
Update the build so that the correct dropin is found for the platform that the build is executing on. Fix an issue when unzipping on macOS such that the executable isn't executable. Change-Id: If74f038ab96d36620296a92d0ab6ff4b5564fac1 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/pom.xml53
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java10
2 files changed, 58 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/pom.xml b/bundles/org.eclipse.equinox.p2.tests/pom.xml
index 952bfe152..11570c4e6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/pom.xml
@@ -22,9 +22,6 @@
<properties>
<testSuite>${project.artifactId}</testSuite>
<testClass>org.eclipse.equinox.p2.tests.AutomatedTests</testClass>
- <!-- despite best inentions I was not able to add automatiz detection here -->
- <!-- Linux is default because Hudson runs those tests on Linux -->
- <dropinsProduct>org.eclipse.equinox.p2.reconciler-linux.gtk.x86_64.tar.gz</dropinsProduct>
</properties>
<build>
@@ -49,4 +46,54 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>mac_x86_64</id>
+ <activation>
+ <os>
+ <family>mac</family>
+ <arch>x86_64</arch>
+ </os>
+ </activation>
+ <properties>
+ <dropinsProduct>org.eclipse.equinox.p2.reconciler-macosx.cocoa.x86_64.zip</dropinsProduct>
+ </properties>
+ </profile>
+ <profile>
+ <id>linux_amd64</id>
+ <activation>
+ <os>
+ <family>linux</family>
+ <arch>amd64</arch>
+ </os>
+ </activation>
+ <properties>
+ <dropinsProduct>org.eclipse.equinox.p2.reconciler-linux.gtk.x86_64.tar.gz</dropinsProduct>
+ </properties>
+ </profile>
+ <profile>
+ <id>linux_ppc64le</id>
+ <activation>
+ <os>
+ <family>linux</family>
+ <arch>ppc64le</arch>
+ </os>
+ </activation>
+ <properties>
+ <dropinsProduct>org.eclipse.equinox.p2.reconciler-linux.gtk.ppc64le.tar.gz</dropinsProduct>
+ </properties>
+ </profile>
+ <profile>
+ <id>win_x86_64</id>
+ <activation>
+ <os>
+ <family>win</family>
+ <arch>x86_64</arch>
+ </os>
+ </activation>
+ <properties>
+ <dropinsProduct>org.eclipse.equinox.p2.reconciler-win32.win32.x86_64.zip</dropinsProduct>
+ </properties>
+ </profile>
+ </profiles>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
index 7c54ec066..620c68af0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
@@ -120,6 +120,12 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
exe = new File(output, getExeFolder() + "eclipse");
if (!exe.exists())
fail("Executable file: " + exe.getAbsolutePath() + "(or .exe) not found after extracting: " + file.getAbsolutePath() + " to: " + output);
+ if (!exe.canExecute()) {
+ // Try first to set --x--x--x, then --x------ if we can't do the former
+ if (!exe.setExecutable(true, false) || !exe.setExecutable(true, true)) {
+ fail("Executable file: " + exe.getAbsolutePath() + " is not executable");
+ }
+ }
}
initialized = true;
}
@@ -476,7 +482,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
public Configuration loadConfiguration(File configLocation, File installLocation) {
try {
- return Configuration.load(configLocation, installLocation.toURL());
+ return Configuration.load(configLocation, installLocation.toURI().toURL());
} catch (ProvisionException e) {
fail("Error while reading configuration from " + configLocation);
} catch (MalformedURLException e) {
@@ -494,7 +500,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
File configLocation = new File(output, getRootFolder() + "configuration/org.eclipse.update/platform.xml");
File installLocation = new File(output, getRootFolder());
try {
- configuration.save(configLocation, installLocation.toURL());
+ configuration.save(configLocation, installLocation.toURI().toURL());
} catch (ProvisionException e) {
fail(message, e);
} catch (MalformedURLException e) {

Back to the top