Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-12-13 15:40:46 +0000
committerKrzysztof Daniel2013-12-17 15:22:28 +0000
commit73e3365d5687050be42fe7484560230fc36a99be (patch)
treef83b4c184fc2c78a0f78bc21f91feaaa695ff11e /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
parent39da65192fec835fafe75c0f863a63757b59f2dd (diff)
downloadrt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.tar.gz
rt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.tar.xz
rt.equinox.p2-73e3365d5687050be42fe7484560230fc36a99be.zip
Bug 422054: Create profile from existing bundles.infoI20131224-0800
I've hijacked the bug for the purpose of something that is remotely connected to the problem. Previous commit extends simpleconfigurator to load bundles from different locations, but such an extension breaks p2, as the content of OSGi application no longer corresponds to profile. In order to fix that, following things are done: 0. A fragment must contain valid P2 metadata next to the .info file. 1. User profile is dropped when there is master configuration change. Also, when fragments are changed. 2. When a new surrogate profile is created, P2 will add to the master profile all the units that are found in the fragments repos. Therefore new user profile will contain all the units that were installed by the simpleconfigurator. Fragment repos must be runnable. 3. The director application must be configured with extensions if it is supposed to work. Change-Id: I6e857ea51dd32ae7fab39d9c39bec8a91eb203b7 Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java14
1 files changed, 13 insertions, 1 deletions
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 1d939287f..e0efd9a6a 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
@@ -6,6 +6,7 @@
*
* Contributors:
* Ericsson AB - initial API and implementation
+ * Red Hat, Inc. - fragments support
******************************************************************************/
package org.eclipse.equinox.p2.tests.sharedinstall;
@@ -103,6 +104,16 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
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()});
}
+ @Override
+ protected void tearDown() throws Exception {
+ if (readOnlyBase != null && readOnlyBase.exists()) {
+ setReadOnly(readOnlyBase, false);
+ }
+ delete(readOnlyBase);
+ delete(userBase);
+ super.tearDown();
+ }
+
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()});
}
@@ -161,7 +172,7 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
realExecuteVerifier(verificationProperties, false);
}
- private void realExecuteVerifier(Properties verificationProperties, boolean withConfigFlag) {
+ protected void realExecuteVerifier(Properties verificationProperties, boolean withConfigFlag) {
File verifierConfig = new File(getTempFolder(), "verification.properties");
try {
writeProperties(verifierConfig, verificationProperties);
@@ -231,6 +242,7 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
public static void setupReadOnlyInstall() {
readOnlyBase = new File(output, "eclipse");
+ readOnlyBase.mkdirs();
assertTrue(readOnlyBase.canWrite());
setReadOnly(readOnlyBase, true);
userBase = new File(output, "user");

Back to the top