summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-04-05 20:17:16 (EDT)
committerPascal Rapicault2013-04-05 20:17:16 (EDT)
commitf1234380acbcaa417f903667243d9441cda35fa6 (patch)
treefcb6c4e95bfb43c5f416b88b8253d80b203a7f21
parentcacedf0145c6fc46e417a2cfe5960c4913562e38 (diff)
downloadrt.equinox.p2-f1234380acbcaa417f903667243d9441cda35fa6.zip
rt.equinox.p2-f1234380acbcaa417f903667243d9441cda35fa6.tar.gz
rt.equinox.p2-f1234380acbcaa417f903667243d9441cda35fa6.tar.bz2
New test cases and simple refactoring to accomodate those
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MigrationWizardTestHelper.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AllTests.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChange.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChangeWithoutUserChange.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/DoubleBaseChange.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/InstallInUserSpace.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/MultipleChanges.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/artifacts.jarbin662 -> 667 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/content.jarbin1402 -> 1416 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304041339.jarbin423 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304051618.jarbin0 -> 424 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304041339.jarbin407 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304051618.jarbin0 -> 408 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304041339.jarbin407 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304051618.jarbin0 -> 407 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304041339.jarbin19476 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304051618.jarbin0 -> 21793 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304041339.jarbin394 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304051618.jarbin0 -> 394 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304041339.jarbin393 -> 0 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304051618.jarbin0 -> 393 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/readme.txt4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/build.properties4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.project28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/build.properties4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/.project17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/build.properties1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/feature.xml26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/.project17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/build.properties1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/feature.xml26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/site/site.xml13
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdatePlugin.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/ImportFromInstallationWizard_c.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java20
45 files changed, 462 insertions, 31 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MigrationWizardTestHelper.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MigrationWizardTestHelper.java
new file mode 100644
index 0000000..49635a0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/MigrationWizardTestHelper.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson AB and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson AB - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.internal.p2.tests.verifier;
+
+import java.net.URI;
+import org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport;
+import org.eclipse.equinox.p2.engine.IProfile;
+
+public class MigrationWizardTestHelper extends MigrationSupport {
+ //Variable that keeps track if the wizard has been requested to open
+ public boolean wizardOpened = false;
+
+ @Override
+ protected void openMigrationWizard(IProfile inputProfile, URI[] reposToMigrate) {
+ wizardOpened = true;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
index d8ad7f1..2527e5f 100644
--- a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
+++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
@@ -281,7 +281,7 @@ public class VerifierApplication implements IApplication {
IProfile profile = registry.getProfile(IProfileRegistry.SELF);
if (profile == null)
return createError("SELF profile not available in profile registry."); //$NON-NLS-1$
- if (!Boolean.FALSE.toString().equals(properties.get("checkPresenceOfVerifier"))) {
+ if (properties.get("checkPresenceOfVerifier") != null && !Boolean.FALSE.toString().equals(properties.get("checkPresenceOfVerifier"))) {
IQueryResult results = profile.query(QueryUtil.createIUQuery(Activator.PLUGIN_ID), null);
if (results.isEmpty())
return createError(NLS.bind("IU for {0} not found in SELF profile.", Activator.PLUGIN_ID)); //$NON-NLS-1$
@@ -322,6 +322,11 @@ public class VerifierApplication implements IApplication {
if (!temp.isOK())
result.merge(temp);
+ temp = checkMigrationWizard();
+ if (!temp.isOK())
+ result.merge(temp);
+
+ assumeMigrated();
return result;
}
@@ -412,4 +417,31 @@ public class VerifierApplication implements IApplication {
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The flag indicating that a profile has been reset is incorrectly setup");
}
+
+ private IStatus checkMigrationWizard() {
+ if (properties.getProperty("checkMigrationWizard") == null)
+ return Status.OK_STATUS;
+
+ IProfileRegistry reg = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
+ IProfile profile = reg.getProfile(IProfileRegistry.SELF);
+
+ //Fake the opening of the wizard
+ MigrationWizardTestHelper migrationSupport = new MigrationWizardTestHelper();
+ migrationSupport.performMigration(agent, reg, profile);
+
+ boolean wizardExpectedToOpen = Boolean.parseBoolean(properties.getProperty("checkMigrationWizard.open"));
+ if (migrationSupport.wizardOpened == wizardExpectedToOpen)
+ return Status.OK_STATUS;
+
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The migration wizard did " + (wizardExpectedToOpen ? "not" : "") + " open");
+ }
+
+ private void assumeMigrated() {
+ if (properties.getProperty("checkMigrationWizard.simulate.reinstall") == null)
+ return;
+
+ IProfileRegistry reg = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
+ IProfile profile = reg.getProfile(IProfileRegistry.SELF);
+ new MigrationWizardTestHelper().rememberMigrationCompleted(profile.getProfileId());
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index 7a64aeb..15ff547 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -1039,6 +1039,18 @@ public abstract class AbstractProvisioningTest extends TestCase {
return install(req, planner, engine);
}
+ protected IStatus installAsRootsAndFlaggedAsBase(IProfile profile, IInstallableUnit[] ius, boolean strict, IPlanner planner, IEngine engine) {
+ ProfileChangeRequest req = new ProfileChangeRequest(profile);
+ for (int i = 0; i < ius.length; i++) {
+ req.add(ius[i]);
+ req.setInstallableUnitInclusionRules(ius[i], strict ? ProfileInclusionRules.createStrictInclusionRule(ius[i]) : ProfileInclusionRules.createOptionalInclusionRule(ius[i]));
+ req.setInstallableUnitProfileProperty(ius[i], IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString());
+ req.setInstallableUnitProfileProperty(ius[i], "org.eclipse.equinox.p2.base", Boolean.TRUE.toString());
+ }
+
+ return install(req, planner, engine);
+ }
+
protected IStatus install(IProfile profile, IInstallableUnit[] ius, boolean strict, IPlanner planner, IEngine engine) {
ProfileChangeRequest req = new ProfileChangeRequest(profile);
for (int i = 0; i < ius.length; i++) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
index e07ca2d..c7cd662 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
@@ -94,12 +94,16 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
}
- protected void installInUser() {
+ protected void installFeature1AndVerifierInUser() {
//TODO Install something into eclipse - make sure that this can be done in an automated setup
runEclipse("Installing in user", output, new String[] {"-configuration", userBase.getAbsolutePath() + java.io.File.separatorChar + "configuration", "-application", "org.eclipse.equinox.p2.director", "-installIU", "p2TestFeature1.feature.group,Verifier.feature.group", "-repository", getTestRepo()});
}
- protected void installInUser2() {
+ protected void installFeature1InUser() {
+ runEclipse("user2", output, new String[] {"-configuration", userBase.getAbsolutePath() + java.io.File.separatorChar + "configuration", "-application", "org.eclipse.equinox.p2.director", "-installIU", "p2TestFeature1.feature.group", "-repository", getTestRepo()});
+ }
+
+ protected void installFeature2InUser() {
runEclipse("user2", output, new String[] {"-configuration", userBase.getAbsolutePath() + java.io.File.separatorChar + "configuration", "-application", "org.eclipse.equinox.p2.director", "-installIU", "p2TestFeature2.feature.group", "-repository", getTestRepo()});
}
@@ -109,6 +113,24 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
setReadOnly(readOnlyBase, true);
}
+ protected void installVerifierAndFeature1InBase() {
+ setReadOnly(readOnlyBase, false);
+ runEclipse("Running eclipse", output, new String[] {"-application", "org.eclipse.equinox.p2.director", "-installIU", "Verifier.feature.group,p2TestFeature1.feature.group", "-repository", getTestRepo()});
+ setReadOnly(readOnlyBase, true);
+ }
+
+ protected void uninstallFeature1InBase() {
+ setReadOnly(readOnlyBase, false);
+ runEclipse("Running eclipse", output, new String[] {"-application", "org.eclipse.equinox.p2.director", "-uninstallIU", "p2TestFeature1.feature.group", "-repository", getTestRepo()});
+ setReadOnly(readOnlyBase, true);
+ }
+
+ protected void installFeature2InBase() {
+ setReadOnly(readOnlyBase, false);
+ runEclipse("Running eclipse", output, new String[] {"-application", "org.eclipse.equinox.p2.director", "-installIU", "p2TestFeature2.feature.group", "-repository", getTestRepo()});
+ setReadOnly(readOnlyBase, true);
+ }
+
protected boolean isInUserBundlesInfo(String bundleId) {
try {
return isInBundlesInfo(getUserBundlesInfo(), bundleId, null, null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AllTests.java
index d816e23..53d6479 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AllTests.java
@@ -24,6 +24,8 @@ public class AllTests extends TestCase {
suite.addTestSuite(NeedsMigration.class);
suite.addTest(BaseChange.suite());
suite.addTest(BaseChangeWithoutUserChange.suite());
+ suite.addTest(DoubleBaseChange.suite());
+ suite.addTest(MultipleChanges.suite());
suite.addTest(InstallInUserSpace.suite());
suite.addTest(TestInitialRun.suite());
return suite;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChange.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChange.java
index 389b0c1..f438a23 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChange.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChange.java
@@ -34,7 +34,7 @@ public class BaseChange extends AbstractSharedInstallTest {
System.out.println(userBase);
{ //install verifier and something else in user and checks there are there
- installInUser();
+ installFeature1AndVerifierInUser();
Properties verificationProperties = new Properties();
verificationProperties.setProperty("expectedBundleList", "p2TestBundle1,org.eclipse.equinox.p2.tests.verifier");
verificationProperties.setProperty("checkProfileResetFlag", "false");
@@ -54,6 +54,8 @@ public class BaseChange extends AbstractSharedInstallTest {
verificationProperties.setProperty("expectedBundleList", "org.eclipse.equinox.p2.tests.verifier");
verificationProperties.setProperty("checkProfileResetFlag", "true");
verificationProperties.setProperty("sysprop.eclipse.ignoreUserConfiguration", "profileFlushed");
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "true");
executeVerifier(verificationProperties);
assertTrue(isInUserBundlesInfo("p2TestBundle1")); //Despite the reset, the bundles.info is still on-disk unmodified since no provisioning has been done
assertProfileStatePropertiesHasKey(getUserProfileFolder(), "_simpleProfileRegistry_internal_" + getMostRecentProfileTimestampFromBase());
@@ -67,7 +69,7 @@ public class BaseChange extends AbstractSharedInstallTest {
}
{ //Now add something into the user install again
- installInUser2();
+ installFeature2InUser();
Properties verificationProperties = new Properties();
verificationProperties.setProperty("expectedBundleList", "org.eclipse.equinox.p2.tests.verifier");
executeVerifier(verificationProperties);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChangeWithoutUserChange.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChangeWithoutUserChange.java
index 4260b0c..e17d443 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChangeWithoutUserChange.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/BaseChangeWithoutUserChange.java
@@ -40,20 +40,29 @@ public class BaseChangeWithoutUserChange extends AbstractSharedInstallTest {
}
{ //Change the base and then verify
- installVerifierInBase();
+ installVerifierAndFeature1InBase();
assertFalse(getUserBundleInfo().exists());
assertFalse(getUserBundleInfoTimestamp().exists());
Properties verificationProperties = new Properties();
- verificationProperties.setProperty("unexpectedBundleList", "p2TestBundle1");
- verificationProperties.setProperty("checkPresenceOfVerifier", "false");
- verificationProperties.setProperty("expectedBundleList", "org.eclipse.equinox.p2.tests.verifier");
+ verificationProperties.setProperty("expectedBundleList", "p2TestBundle1,org.eclipse.equinox.p2.tests.verifier");
verificationProperties.setProperty("checkProfileResetFlag", "true");
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "false");
+ verificationProperties.setProperty("checkMigrationWizard.assumeMigrated", "true");
executeVerifier(verificationProperties);
assertProfileStatePropertiesHasKey(getUserProfileFolder(), "_simpleProfileRegistry_internal_" + getMostRecentProfileTimestampFromBase());
}
+
+ {
+ uninstallFeature1InBase();
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "false");
+ executeVerifier(verificationProperties);
+ }
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/DoubleBaseChange.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/DoubleBaseChange.java
new file mode 100644
index 0000000..4163272
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/DoubleBaseChange.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson AB and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson AB - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.p2.tests.sharedinstall;
+
+import java.util.Properties;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.equinox.p2.tests.reconciler.dropins.ReconcilerTestSuite;
+
+public class DoubleBaseChange extends AbstractSharedInstallTest {
+
+ public static Test suite() {
+ TestSuite suite = new ReconcilerTestSuite();
+ suite.setName(DoubleBaseChange.class.getName());
+ suite.addTest(new DoubleBaseChange("testTwoChanges"));
+ return suite;
+ }
+
+ public DoubleBaseChange(String name) {
+ super(name);
+ }
+
+ public void testTwoChanges() {
+ assertInitialized();
+ setupReadOnlyInstall();
+ System.out.println(readOnlyBase);
+ System.out.println(userBase);
+
+ { //install verifier and feature1
+ installFeature1AndVerifierInUser();
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("expectedBundleList", "p2TestBundle1,org.eclipse.equinox.p2.tests.verifier");
+ verificationProperties.setProperty("checkProfileResetFlag", "false");
+ verificationProperties.setProperty("not.sysprop.eclipse.ignoreUserConfiguration", "");
+ executeVerifier(verificationProperties);
+
+ assertTrue(isInUserBundlesInfo("p2TestBundle1"));
+ assertProfileStatePropertiesHasKey(getUserProfileFolder(), "_simpleProfileRegistry_internal_" + getMostRecentProfileTimestampFromBase());
+ }
+
+ { //Now change the base twice in a row and then check if the wizard opens
+ installVerifierInBase();
+ installFeature2InBase();
+
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "true");
+ executeVerifier(verificationProperties);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/InstallInUserSpace.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/InstallInUserSpace.java
index cb69fe3..b474a54 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/InstallInUserSpace.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/InstallInUserSpace.java
@@ -33,7 +33,7 @@ public class InstallInUserSpace extends AbstractSharedInstallTest {
System.out.println(readOnlyBase);
System.out.println(userBase);
- installInUser();
+ installFeature1AndVerifierInUser();
assertTrue(isInUserBundlesInfo("p2TestBundle1"));
assertTrue(isInUserBundlesInfo("org.eclipse.swt")); //this verifies that we have the bundles from the base installed in the user bundles.info
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/MultipleChanges.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/MultipleChanges.java
new file mode 100644
index 0000000..780379c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/MultipleChanges.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson AB and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ericsson AB - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.equinox.p2.tests.sharedinstall;
+
+import java.util.Properties;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.equinox.p2.tests.reconciler.dropins.ReconcilerTestSuite;
+
+public class MultipleChanges extends AbstractSharedInstallTest {
+
+ public static Test suite() {
+ TestSuite suite = new ReconcilerTestSuite();
+ suite.setName(MultipleChanges.class.getName());
+ suite.addTest(new MultipleChanges("testMultipleChangesWithExecution"));
+ return suite;
+ }
+
+ public MultipleChanges(String name) {
+ super(name);
+ }
+
+ public void testMultipleChangesWithExecution() {
+ assertInitialized();
+ setupReadOnlyInstall();
+ System.out.println(readOnlyBase);
+ System.out.println(userBase);
+
+ { //install verifier and feature1
+ installFeature1AndVerifierInUser();
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("expectedBundleList", "p2TestBundle1,org.eclipse.equinox.p2.tests.verifier");
+ verificationProperties.setProperty("checkProfileResetFlag", "false");
+ verificationProperties.setProperty("not.sysprop.eclipse.ignoreUserConfiguration", "");
+ executeVerifier(verificationProperties);
+
+ assertTrue(isInUserBundlesInfo("p2TestBundle1"));
+ assertProfileStatePropertiesHasKey(getUserProfileFolder(), "_simpleProfileRegistry_internal_" + getMostRecentProfileTimestampFromBase());
+ }
+
+ { //Add the verifier in the base and check that the wizard opens
+ installVerifierInBase();
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "true");
+ verificationProperties.setProperty("checkMigrationWizard.assumeMigrated", "true");
+ executeVerifier(verificationProperties);
+ installFeature1InUser(); //We are doing this because the code that actually do the installation in the wizard is *not* invoked
+ }
+
+ { //Add feature 2 in the base and check the wizard opens
+ installFeature2InBase();
+ Properties verificationProperties = new Properties();
+ verificationProperties.setProperty("checkMigrationWizard", "true");
+ verificationProperties.setProperty("checkMigrationWizard.open", "true");
+ executeVerifier(verificationProperties);
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/artifacts.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/artifacts.jar
index 42c3d08..a1c4cdb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/artifacts.jar
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/artifacts.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/content.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/content.jar
index b4e16e4..0f6ab92 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/content.jar
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/content.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304041339.jar
deleted file mode 100644
index d048115..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304051618.jar
new file mode 100644
index 0000000..80687d3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/Verifier_1.0.0.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304041339.jar
deleted file mode 100644
index 9d95765..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304051618.jar
new file mode 100644
index 0000000..edda04e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature1_1.0.0.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304041339.jar
deleted file mode 100644
index 4842fec..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304051618.jar
new file mode 100644
index 0000000..c8065be
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/features/p2TestFeature2_1.0.0.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304041339.jar
deleted file mode 100644
index 9c09f05..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304051618.jar
new file mode 100644
index 0000000..e368ff1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/org.eclipse.equinox.p2.tests.verifier_1.0.100.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304041339.jar
deleted file mode 100644
index ca21413..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304051618.jar
new file mode 100644
index 0000000..4653648
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle1_1.0.0.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304041339.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304041339.jar
deleted file mode 100644
index 18bd248..0000000
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304041339.jar
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304051618.jar b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304051618.jar
new file mode 100644
index 0000000..d128775
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/plugins/p2TestBundle2_1.0.0.201304051618.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/readme.txt b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/readme.txt
index d23b9bd..2372551 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/readme.txt
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/repo/readme.txt
@@ -1,3 +1,5 @@
This repository is used by the SharedInstallEnd2End test.
It contains two dummy bundles installable by two dummy features. Those are just used to install content into the base or the user install.
-It also contains the code of the p2 verifier bundle wrapped by a feature to make it easily installable. \ No newline at end of file
+It also contains the code of the p2 verifier bundle wrapped by a feature to make it easily installable.
+
+The source code is available in the folder called source sibling of the folder containing this file. \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.classpath b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.project b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.project
new file mode 100644
index 0000000..c267a4e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>p2TestBundle1</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..af0f20f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..47eb93b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: P2TestBundle1
+Bundle-SymbolicName: p2TestBundle1
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/build.properties b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle1/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.classpath b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.project b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.project
new file mode 100644
index 0000000..5013ee7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>p2TestBundle2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..af0f20f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..c0ce004
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: P2TestBundle2
+Bundle-SymbolicName: p2TestBundle2
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/build.properties b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestBundle2/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/.project b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/.project
new file mode 100644
index 0000000..03c76ad
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>p2TestFeature1</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/build.properties b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/feature.xml b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/feature.xml
new file mode 100644
index 0000000..c729850
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature1/feature.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="p2TestFeature1"
+ label="P2TestFeature1"
+ version="1.0.0.qualifier">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <plugin
+ id="p2TestBundle1"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/.project b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/.project
new file mode 100644
index 0000000..c49f2f3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>p2TestFeature2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/build.properties b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/feature.xml b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/feature.xml
new file mode 100644
index 0000000..646a861
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/p2TestFeature2/feature.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="p2TestFeature2"
+ label="P2TestFeature2"
+ version="1.0.0.qualifier">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <plugin
+ id="p2TestBundle2"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/site/site.xml b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/site/site.xml
new file mode 100644
index 0000000..0befa62
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/sharedInstall/source/site/site.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <feature url="features/Verifier_1.0.0.201304051618.jar" id="Verifier" version="1.0.0.201304051618">
+ <category name="c1"/>
+ </feature>
+ <feature url="features/p2TestFeature1_1.0.0.201304051618.jar" id="p2TestFeature1" version="1.0.0.201304051618">
+ <category name="c1"/>
+ </feature>
+ <feature url="features/p2TestFeature2_1.0.0.201304051618.jar" id="p2TestFeature2" version="1.0.0.201304051618">
+ <category name="c1"/>
+ </feature>
+ <category-def name="c1" label="c1"/>
+</site>
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdatePlugin.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdatePlugin.java
index 9e99a42..c55d000 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdatePlugin.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdatePlugin.java
@@ -19,7 +19,6 @@ import org.eclipse.equinox.p2.core.*;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.ProfileScope;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
-import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
@@ -191,17 +190,4 @@ public class AutomaticUpdatePlugin extends AbstractUIPlugin {
getContext().ungetService(ref);
return agentProvider;
}
-
- //TODO Find a better place for these two methods
- public void rememberMigrationCompleted(String profileId) {
- IProfileRegistry registry = (IProfileRegistry) ProvisioningUI.getDefaultUI().getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME);
- long[] history = registry.listProfileTimestamps(profileId);
- AutomaticUpdatePlugin.getDefault().getPreferenceStore().setValue(AutomaticUpdateScheduler.MIGRATION_DIALOG_SHOWN, history[history.length - 1]);
- AutomaticUpdatePlugin.getDefault().savePreferences();
- }
-
- //Get the timestamp that we migrated from. O if we have not migrated.
- public long getLastMigration() {
- return AutomaticUpdatePlugin.getDefault().getPreferenceStore().getLong(AutomaticUpdateScheduler.MIGRATION_DIALOG_SHOWN);
- }
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/ImportFromInstallationWizard_c.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/ImportFromInstallationWizard_c.java
index 8587069..1c4c7e7 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/ImportFromInstallationWizard_c.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/ImportFromInstallationWizard_c.java
@@ -123,7 +123,7 @@ public class ImportFromInstallationWizard_c extends InstallWizard implements IIm
//Remember that we completed the migration
private void rememberMigrationCompleted() {
- AutomaticUpdatePlugin.getDefault().rememberMigrationCompleted(toImportFrom.getProfileId());
+ new MigrationSupport().rememberMigrationCompleted(toImportFrom.getProfileId());
}
//Purge the profile registry from all the entries that are no longer relevant
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
index 42ac844..572211f 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationSupport.java
@@ -16,8 +16,7 @@ import java.util.Set;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.engine.EngineActivator;
import org.eclipse.equinox.internal.p2.metadata.query.UpdateQuery;
-import org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatePlugin;
-import org.eclipse.equinox.internal.p2.ui.sdk.scheduler.PreviousConfigurationFinder;
+import org.eclipse.equinox.internal.p2.ui.sdk.scheduler.*;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
@@ -28,6 +27,7 @@ import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.swt.widgets.Display;
@@ -73,7 +73,7 @@ public class MigrationSupport {
openMigrationWizard(previousProfile, reposToMigrate);
} else {
//There is nothing to migrate, so we mark the migration complete
- AutomaticUpdatePlugin.getDefault().rememberMigrationCompleted(currentProfile.getProfileId());
+ rememberMigrationCompleted(currentProfile.getProfileId());
}
return true;
}
@@ -114,7 +114,7 @@ public class MigrationSupport {
long[] history = registry.listProfileTimestamps(currentProfile.getProfileId());
boolean isInitial = !IProfile.STATE_SHARED_INSTALL_VALUE_INITIAL.equals(registry.getProfileStateProperties(currentProfile.getProfileId(), history[0]).get(IProfile.STATE_PROP_SHARED_INSTALL));
if (isInitial) {
- if (AutomaticUpdatePlugin.getDefault().getLastMigration() >= history[0])
+ if (getLastMigration() >= history[0])
return false;
return true;
}
@@ -169,7 +169,7 @@ public class MigrationSupport {
}
private boolean baseChangedSinceLastPresentationOfWizard(IProvisioningAgent agent, IProfileRegistry registry, IProfile profile) {
- long lastProfileMigrated = AutomaticUpdatePlugin.getDefault().getLastMigration();
+ long lastProfileMigrated = getLastMigration();
long lastResetTimestamp = findMostRecentResetTimestamp(registry, profile);
return lastProfileMigrated <= lastResetTimestamp;
}
@@ -197,7 +197,17 @@ public class MigrationSupport {
Shell getWorkbenchWindowShell() {
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
return activeWindow != null ? activeWindow.getShell() : null;
+ }
+ public void rememberMigrationCompleted(String profileId) {
+ IProfileRegistry registry = (IProfileRegistry) ProvisioningUI.getDefaultUI().getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME);
+ long[] history = registry.listProfileTimestamps(profileId);
+ AutomaticUpdatePlugin.getDefault().getPreferenceStore().setValue(AutomaticUpdateScheduler.MIGRATION_DIALOG_SHOWN, history[history.length - 1]);
+ AutomaticUpdatePlugin.getDefault().savePreferences();
}
+ //Get the timestamp that we migrated from. O if we have not migrated.
+ public long getLastMigration() {
+ return AutomaticUpdatePlugin.getDefault().getPreferenceStore().getLong(AutomaticUpdateScheduler.MIGRATION_DIALOG_SHOWN);
+ }
}