summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-04-09 21:57:35 (EDT)
committerPascal Rapicault2013-04-16 12:10:07 (EDT)
commitb488ec8cf71d0821de5a0e7b065ccadb18e569a3 (patch)
tree398802518febdd8babdd66868ce2eb3171da3097
parent2a251ffa6ee938ab71f29c6d6db26bc7d7634c21 (diff)
downloadrt.equinox.p2-b488ec8cf71d0821de5a0e7b065ccadb18e569a3.zip
rt.equinox.p2-b488ec8cf71d0821de5a0e7b065ccadb18e569a3.tar.gz
rt.equinox.p2-b488ec8cf71d0821de5a0e7b065ccadb18e569a3.tar.bz2
Reorg test data for preference tests in shared install
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTestWithDataInUser.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/1339695683273.profile4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/state.properties1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.prefs3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/1339695683273.profile4
9 files changed, 61 insertions, 26 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java
index 2598172..a81b799 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java
@@ -33,13 +33,14 @@ public class SharedProfilePreferencesTest extends AbstractProvisioningTest {
Bundle p2Core = Platform.getBundle("org.eclipse.equinox.p2.core");
p2Core.stop();
- File baseInstallToCopy = getTestData("baseInstall", "testData/sharedPrefs/baseInstall");
+ //We have to do all this dance to copy the files because if we store them at the actual path, then the path is too long
+ File baseInstallToCopy = getTestData("baseInstall", "testData/sharedPrefs/test1/baseInstall");
File baseInstall = getTempFolder();
File baseInstallToCopyTo = new File(baseInstall, "p2/org.eclipse.equinox.p2.engine/profileRegistry");
baseInstallToCopy.mkdirs();
copy("copy base install", baseInstallToCopy, baseInstallToCopyTo);
- File userHomeToCopy = getTestData("useHome", "testData/sharedPrefs/userHome");
+ File userHomeToCopy = getTestData("useHome", "testData/sharedPrefs/test1/userHome");
File userHome = getTempFolder();
File userHomeToCopyTo = new File(userHome, "p2/org.eclipse.equinox.p2.engine/");
userHomeToCopyTo.mkdirs();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTestWithDataInUser.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTestWithDataInUser.java
index 431151b..3b0beba 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTestWithDataInUser.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTestWithDataInUser.java
@@ -11,10 +11,8 @@ package org.eclipse.equinox.p2.tests.sharedinstall;
* Pascal Rapicault (Ericsson) - Initial API and implementation
*******************************************************************************/
import java.io.File;
-import java.io.IOException;
import java.net.URI;
-import java.net.URL;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.repository.Activator;
@@ -26,33 +24,25 @@ import org.eclipse.equinox.p2.tests.TestActivator;
import org.osgi.framework.Bundle;
public class SharedProfilePreferencesTestWithDataInUser extends AbstractProvisioningTest {
- protected File getTestData(String message, String entry) {
- if (entry == null)
- fail(message + " entry is null.");
- URL base = Platform.getBundle("org.eclipse.equinox.p2.tests.sharedinstall").getEntry(entry);
- if (base == null)
- fail(message + " entry not found in bundle: " + entry);
- try {
- String osPath = new Path(FileLocator.toFileURL(base).getPath()).toOSString();
- File result = new File(osPath);
- if (!result.getCanonicalPath().equals(result.getPath()))
- fail(message + " result path: " + result.getPath() + " does not match canonical path: " + result.getCanonicalFile().getPath());
- return result;
- } catch (IOException e) {
- fail(message, e);
- }
- // avoid compile error... should never reach this code
- return null;
- }
-
protected void setUp() throws Exception {
//We don't call super.setUp() on purpose
Bundle p2Core = Platform.getBundle("org.eclipse.equinox.p2.core");
p2Core.stop();
- File baseInstall = getTestData("test shared install", "data/test1/base");
- File userHome = getTestData("test shared install", "data/test1/user");
+ //We have to do all this dance to copy the files because if we store them at the actual path, then the path is too long
+ File baseInstallToCopy = getTestData("baseInstall", "testData/sharedPrefs/test2/baseInstall");
+ File baseInstall = getTempFolder();
+ File baseInstallToCopyTo = new File(baseInstall, "p2/org.eclipse.equinox.p2.engine/profileRegistry");
+ baseInstallToCopy.mkdirs();
+ copy("copy base install", baseInstallToCopy, baseInstallToCopyTo);
+
+ File userHomeToCopy = getTestData("useHome", "testData/sharedPrefs/test2/userHome");
+ File userHome = getTempFolder();
+ File userHomeToCopyTo = new File(userHome, "p2/org.eclipse.equinox.p2.engine/profileRegistry");
+ userHomeToCopyTo.mkdirs();
+ copy("copy user home data", userHomeToCopy, userHomeToCopyTo);
+
System.setProperty("osgi.sharedConfiguration.area", new File(baseInstall, "configuration").toURI().toString());
System.setProperty("osgi.configuration.area", new File(userHome, "configuration").toURI().toString());
System.setProperty("eclipse.p2.profile", "epp.package.java");
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs
new file mode 100644
index 0000000..8cb4991
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/count=1
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/enabled=true
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/nickname=The Eclipse Project Updates
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/uri=http\://download.eclipse.org/eclipse/updates/4.2
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/count=3
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/enabled=true
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/nickname=Mylyn for Eclipse Juno
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/uri=http\://download.eclipse.org/mylyn/releases/juno
+repositories/http\:__download.eclipse.org_releases_juno/count=1
+repositories/http\:__download.eclipse.org_releases_juno/enabled=true
+repositories/http\:__download.eclipse.org_releases_juno/nickname=Juno
+repositories/http\:__download.eclipse.org_releases_juno/uri=http\://download.eclipse.org/releases/juno
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs
new file mode 100644
index 0000000..8cb4991
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs
@@ -0,0 +1,13 @@
+eclipse.preferences.version=1
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/count=1
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/enabled=true
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/nickname=The Eclipse Project Updates
+repositories/http\:__download.eclipse.org_eclipse_updates_4.2/uri=http\://download.eclipse.org/eclipse/updates/4.2
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/count=3
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/enabled=true
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/nickname=Mylyn for Eclipse Juno
+repositories/http\:__download.eclipse.org_mylyn_releases_juno/uri=http\://download.eclipse.org/mylyn/releases/juno
+repositories/http\:__download.eclipse.org_releases_juno/count=1
+repositories/http\:__download.eclipse.org_releases_juno/enabled=true
+repositories/http\:__download.eclipse.org_releases_juno/nickname=Juno
+repositories/http\:__download.eclipse.org_releases_juno/uri=http\://download.eclipse.org/releases/juno
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/1339695683273.profile b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/1339695683273.profile
new file mode 100644
index 0000000..6f18bb0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/1339695683273.profile
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?profile version='1.0.0'?>
+<profile id='epp.package.java' timestamp='1339695683273'>
+</profile>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/state.properties b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/state.properties
new file mode 100644
index 0000000..bd469b5
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/baseInstall/epp.package.java.profile/state.properties
@@ -0,0 +1 @@
+#Thu Jun 14 13:41:23 EDT 2012
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs
new file mode 100644
index 0000000..3e0847a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+repositories/file\:_C\:_dev_tmp/uri=file\:/C\:/dev/tmp/
+repositories/file\:_C\:_dev_tmp/uri=file\:/C\:/dev/tmp/
+repositories/file\:_C\:_dev_tmp/enabled=true
+repositories/file\:_C\:_dev_tmp/nickname=TMP
+
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.prefs
new file mode 100644
index 0000000..05c8680
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/.data/.settings/org.eclipse.equinox.p2.ui.sdk.prefs
@@ -0,0 +1,3 @@
+allowNonOKPlan=prompt
+eclipse.preferences.version=1
+showLatestVersion=true
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/1339695683273.profile b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/1339695683273.profile
new file mode 100644
index 0000000..6f18bb0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedPrefs/test2/userHome/epp.package.java.profile/1339695683273.profile
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?profile version='1.0.0'?>
+<profile id='epp.package.java' timestamp='1339695683273'>
+</profile>