Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-04-01 00:26:24 -0400
committerPascal Rapicault2015-04-01 00:26:24 -0400
commit3b83c56d53a46c107b4cf2e263ddb705866620bf (patch)
tree8cab5910b5330aea08da5d4452cafc050955c368
parenta7befc1eb048a73e91aa74ede76165a269e7fc1e (diff)
downloadrt.equinox.p2-3b83c56d53a46c107b4cf2e263ddb705866620bf.tar.gz
rt.equinox.p2-3b83c56d53a46c107b4cf2e263ddb705866620bf.tar.xz
rt.equinox.p2-3b83c56d53a46c107b4cf2e263ddb705866620bf.zip
Tweak the reconciler tests to run on Mac new layout
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabled.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java8
4 files changed, 36 insertions, 22 deletions
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 4a7ad3e53..f15f05412 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
@@ -83,9 +83,9 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
} else {
untar("1.0", file);
}
- File exe = new File(output, "eclipse/eclipse.exe");
+ File exe = new File(output, getExeFolder() + "eclipse.exe");
if (!exe.exists()) {
- exe = new File(output, "eclipse/eclipse");
+ exe = new File(output, getExeFolder() + "eclipse");
if (!exe.exists())
fail("Executable file: " + exe.getAbsolutePath() + "(or .exe) not found after extracting: " + file.getAbsolutePath() + " to: " + output);
}
@@ -240,7 +240,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
public void add(String message, String target, File file) {
if (!(target.startsWith("dropins") || target.startsWith("plugins") || target.startsWith("features")))
fail("Destination folder for resource copying should be either dropins, plugins or features.");
- File destinationParent = new File(output, "eclipse/" + target);
+ File destinationParent = new File(output, getRootFolder() + target);
destinationParent.mkdirs();
copy(message, file, new File(destinationParent, file.getName()));
}
@@ -249,7 +249,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* Create a link file in the links folder. Point it to the given extension location.
*/
public void createLinkFile(String message, String filename, String extensionLocation) {
- File file = new File(output, "eclipse/links/" + filename + ".link");
+ File file = new File(output, getRootFolder() + "links/" + filename + ".link");
file.getParentFile().mkdirs();
Properties properties = new Properties();
properties.put("path", extensionLocation);
@@ -273,7 +273,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* Delete the link file with the given name from the links folder.
*/
public void removeLinkFile(String message, String filename) {
- File file = new File(output, "eclipse/links/" + filename + ".link");
+ File file = new File(output, getRootFolder() + "links/" + filename + ".link");
file.delete();
}
@@ -289,7 +289,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
public boolean remove(String message, String target, String filename) {
if (!(target.startsWith("dropins") || target.startsWith("plugins") || target.startsWith("features")))
fail("Target folder for resource deletion should be either dropins, plugins or features.");
- File folder = new File(output, "eclipse/" + target);
+ File folder = new File(output, getRootFolder() + target);
File targetFile = new File(folder, filename);
if (!targetFile.exists())
return false;
@@ -315,7 +315,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
}
protected File getBundlesInfo() {
- return new File(output, "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ return new File(output, getRootFolder() + "configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
}
public boolean isInBundlesInfo(String bundleId, String version) throws IOException {
@@ -451,8 +451,8 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* Read and return the configuration object. Will not return null.
*/
public Configuration getConfiguration() {
- File configLocation = new File(output, "eclipse/configuration/org.eclipse.update/platform.xml");
- File installLocation = new File(output, "eclipse");
+ File configLocation = new File(output, getRootFolder() + "configuration/org.eclipse.update/platform.xml");
+ File installLocation = new File(output, getRootFolder());
return loadConfiguration(configLocation, installLocation);
}
@@ -473,8 +473,8 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* Save the given configuration to disk.
*/
public void save(String message, Configuration configuration) {
- File configLocation = new File(output, "eclipse/configuration/org.eclipse.update/platform.xml");
- File installLocation = new File(output, "eclipse");
+ File configLocation = new File(output, getRootFolder() + "configuration/org.eclipse.update/platform.xml");
+ File installLocation = new File(output, getRootFolder());
try {
configuration.save(configLocation, installLocation.toURL());
} catch (ProvisionException e) {
@@ -583,7 +583,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* is installed. We do this by loading the profile registry and seeing if it is there.
*/
public boolean isInstalled(String id, String version) {
- File location = new File(output, "eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry");
+ File location = new File(output, getRootFolder() + "/p2/org.eclipse.equinox.p2.engine/profileRegistry");
SimpleProfileRegistry registry = new SimpleProfileRegistry(getAgent(), location, new SurrogateProfileHandler(getAgent()), false);
IProfile[] profiles = registry.getProfiles();
assertEquals("1.0 Should only be one profile in registry.", 1, profiles.length);
@@ -592,7 +592,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
}
public IInstallableUnit getRemoteIU(String id, String version) {
- File location = new File(output, "eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry");
+ File location = new File(output, getRootFolder() + "/p2/org.eclipse.equinox.p2.engine/profileRegistry");
SimpleProfileRegistry registry = new SimpleProfileRegistry(getAgent(), location, new SurrogateProfileHandler(getAgent()), false);
IProfile[] profiles = registry.getProfiles();
assertEquals("1.0 Should only be one profile in registry.", 1, profiles.length);
@@ -622,7 +622,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
exe = new File(root, "java");
assertTrue("Java executable not found in: " + exe.getAbsolutePath(), exe.exists());
List<String> command = new ArrayList<String>();
- Collections.addAll(command, new String[] {(new File(location == null ? output : location, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-nosplash", "-vm", exe.getAbsolutePath()});
+ Collections.addAll(command, new String[] {(new File(location == null ? output : location, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-nosplash", "-vm", exe.getAbsolutePath()});
Collections.addAll(command, args);
Collections.addAll(command, new String[] {"-vmArgs", "-Dosgi.checkConfiguration=true"});
// command-line if you want to run and allow a remote debugger to connect
@@ -746,7 +746,7 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
private void deleteVerifierBundle(File destination) {
if (destination == null)
destination = output;
- destination = new File(destination, "eclipse/plugins");
+ destination = new File(destination, getRootFolder() + "plugins");
File[] verifierBundle = destination.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
@@ -786,4 +786,18 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
}
}
}
+
+ protected String getRootFolder() {
+ String eclipseFolder = "eclipse/";
+ if (Platform.getWS().equals(Platform.WS_COCOA))
+ eclipseFolder = "Eclipse.app/Contents/Eclipse/";
+ return eclipseFolder;
+ }
+
+ protected String getExeFolder() {
+ String eclipseFolder = "eclipse/";
+ if (Platform.getWS().equals(Platform.WS_COCOA))
+ eclipseFolder = "Eclipse.app/Contents/MacOS/";
+ return eclipseFolder;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTests.java
index 8d0fbeab7..048578b34 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTests.java
@@ -48,7 +48,7 @@ public class SharedInstallTests extends AbstractReconcilerTest {
exe = new File(root, "java");
String configuration = new File(userBase, "configuration").getAbsolutePath();
- String[] command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true"};
+ String[] command = new String[] {(new File(output, getExeFolder() + "/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true"};
run(message, command);
}
@@ -75,7 +75,7 @@ public class SharedInstallTests extends AbstractReconcilerTest {
}
protected void setupReadOnlyInstall() {
- readOnlyBase = new File(output, "eclipse");
+ readOnlyBase = new File(output, getRootFolder());
assertTrue(readOnlyBase.canWrite());
setReadOnly(readOnlyBase, true);
userBase = new File(output, "user");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabled.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabled.java
index 1990e5723..a7e3b4c94 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabled.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabled.java
@@ -41,7 +41,7 @@ public class SharedInstallTestsProfileSpoofEnabled extends SharedInstallTests {
exe = new File(root, "java");
String configuration = new File(userBase, "configuration").getAbsolutePath();
- String[] command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.simpleconfigurator.extensions=true"};
+ String[] command = new String[] {(new File(output, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.simpleconfigurator.extensions=true"};
// String[] command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.simpleconfigurator.extended=true", "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"};
run(message, command);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java
index 739eab636..e5dd8284f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java
@@ -53,15 +53,15 @@ public class SharedInstallTestsProfileSpoofEnabledConfigured extends SharedInsta
String command[];
if (!debug) {
if (extensions != null) {
- command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.fragments=" + extensions.toString()};
+ command = new String[] {(new File(output, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.fragments=" + extensions.toString()};
} else {
- command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true"};
+ command = new String[] {(new File(output, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true"};
}
} else {
if (extensions != null) {
- command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.fragments=" + extensions.toString(), "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"};
+ command = new String[] {(new File(output, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Dp2.fragments=" + extensions.toString(), "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"};
} else {
- command = new String[] {(new File(output, "eclipse/eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"};
+ command = new String[] {(new File(output, getExeFolder() + "eclipse")).getAbsolutePath(), "--launcher.suppressErrors", "-debug", "-consolelog", "-nosplash", "-application", "org.eclipse.equinox.p2.reconciler.application", "-configuration", configuration, "-vm", exe.getAbsolutePath(), "-vmArgs", "-Dosgi.checkConfiguration=true", "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"};
}
}
run(message, command);

Back to the top