Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2010-04-21 04:23:02 +0000
committerSimon Kaegi2010-04-21 04:23:02 +0000
commitdc58e7911c41c861ab1272e8d1bb97c0a11c80c2 (patch)
treecbc7028639347b1cdb51ef8f73ab60cc74ed31e6 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine
parent4433d1b65e73eff9f933c4b4ba19d266ab11589c (diff)
downloadrt.equinox.p2-dc58e7911c41c861ab1272e8d1bb97c0a11c80c2.tar.gz
rt.equinox.p2-dc58e7911c41c861ab1272e8d1bb97c0a11c80c2.tar.xz
rt.equinox.p2-dc58e7911c41c861ab1272e8d1bb97c0a11c80c2.zip
Bug 287246 - [shared] Duplication of roots after doing an upgrade
Updating tests
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
index a454357c9..042d21f7c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/SurrogateProfileHandlerTest.java
@@ -82,8 +82,8 @@ public class SurrogateProfileHandlerTest extends AbstractProvisioningTest {
saveProfile(registry, profile);
IProfile surrogateProfile = handler.createProfile(PROFILE_NAME);
assertTrue(handler.isSurrogate(surrogateProfile));
- assertEquals(0, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
- assertEquals(1, queryResultSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(1, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(2, queryResultSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
}
public void testUpdateProfile() throws ProvisionException {
@@ -92,34 +92,34 @@ public class SurrogateProfileHandlerTest extends AbstractProvisioningTest {
profile.setInstallableUnitProperty(createIU("test"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
saveProfile(registry, profile);
IProfile surrogateProfile = handler.createProfile(PROFILE_NAME);
- assertEquals(1, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(1, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(2, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
handler.updateProfile(surrogateProfile);
- assertEquals(1, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(1, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(2, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
Profile writeableSurrogateProfile = (Profile) surrogateProfile;
writeableSurrogateProfile.addInstallableUnit(createIU("surrogate.test"));
writeableSurrogateProfile.setInstallableUnitProperty(createIU("surrogate.test"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
- assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(3, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(2, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(3, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
profile.addInstallableUnit(createIU("test2"));
profile.setInstallableUnitProperty(createIU("test2"), PROP_TYPE_ROOT, Boolean.TRUE.toString());
saveProfile(registry, profile);
- assertEquals(2, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(3, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(3, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(4, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
//Strictly speaking this should not be necessary however without resetting the timestamp this test will sometimes fail
writeableSurrogateProfile.setProperty(PROP_SHARED_TIMESTAMP, null);
handler.updateProfile(surrogateProfile);
- assertEquals(3, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(4, queryResultSize(surrogateProfile.query(QueryUtil.createIUAnyQuery(), null)));
// HashSet used here to eliminate duplicates
- assertEquals(3, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
+ assertEquals(4, queryResultUniqueSize(surrogateProfile.available(QueryUtil.createIUAnyQuery(), null)));
}
}

Back to the top