diff options
author | Pascal Rapicault (Ericsson) | 2013-04-04 18:05:53 +0000 |
---|---|---|
committer | Pascal Rapicault | 2013-04-04 18:05:53 +0000 |
commit | b1752f94bca09254ce97987feff474bd82006b19 (patch) | |
tree | 04a405a75deca792c35e313133fa8c4e6bdcb4c9 /bundles/org.eclipse.equinox.p2.tests.verifier | |
parent | f05563a2311ab48174bdc17054561e384a97547e (diff) | |
download | rt.equinox.p2-b1752f94bca09254ce97987feff474bd82006b19.tar.gz rt.equinox.p2-b1752f94bca09254ce97987feff474bd82006b19.tar.xz rt.equinox.p2-b1752f94bca09254ce97987feff474bd82006b19.zip |
Bug 403722 - [shared][test] 4 shared install tests fail
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.verifier')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java | 20 |
1 files changed, 16 insertions, 4 deletions
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 92b07259d..d8ad7f105 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 @@ -389,15 +389,27 @@ public class VerifierApplication implements IApplication { } private IStatus hasProfileFlag() { - if (properties.getProperty("checkProfileResetFlag") == null) + if (properties.getProperty("checkProfileResetFlag") == null || "false".equals(properties.getProperty("checkProfileResetFlag"))) return Status.OK_STATUS; //Make sure that the profile is already loaded IProfileRegistry reg = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); - reg.getProfile(IProfileRegistry.SELF); + IProfile profile = reg.getProfile(IProfileRegistry.SELF); + String profileId = profile.getProfileId(); - if (Boolean.valueOf(properties.getProperty("checkProfileResetFlag")).booleanValue() == (agent.getService(IProfileRegistry.class.getName() + '_' + "NEW_SELF_TIMESTAMP") != null)) + long history[] = reg.listProfileTimestamps(profileId); + long lastTimestamp = history[history.length - 1]; + if (IProfile.STATE_SHARED_INSTALL_VALUE_NEW.equals(reg.getProfileStateProperties(profileId, lastTimestamp).get(IProfile.STATE_PROP_SHARED_INSTALL))) { return Status.OK_STATUS; + } + if (history.length == 1) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The flag indicating that a profile has been reset is incorrectly setup"); + } + + long previousToLastTimestamp = history[history.length - 2]; + if (IProfile.STATE_SHARED_INSTALL_VALUE_NEW.equals(reg.getProfileStateProperties(profileId, previousToLastTimestamp).get(IProfile.STATE_PROP_SHARED_INSTALL))) { + return Status.OK_STATUS; + } + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The flag indicating that a profile has been reset is incorrectly setup"); } - } |