From b935c7de40bf4ffc05405dc017c5c4d5ce6063b1 Mon Sep 17 00:00:00 2001 From: Pascal Rapicault (Ericsson) Date: Thu, 15 Nov 2012 11:09:41 -0500 Subject: Reorganize test data --- .../tests/sharedinstall/SharedProfilePreferencesTest.java | 13 +++++++++++-- .../org.eclipse.equinox.p2.metadata.repository.prefs | 13 ------------- 2 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 bundles/org.eclipse.equinox.p2.tests.sharedinstall/testData/sharedPreferences/userHome/configuration/p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs diff --git a/bundles/org.eclipse.equinox.p2.tests.sharedinstall/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java b/bundles/org.eclipse.equinox.p2.tests.sharedinstall/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java index fb8b63b13..d0fc256d7 100644 --- a/bundles/org.eclipse.equinox.p2.tests.sharedinstall/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.sharedinstall/src/org/eclipse/equinox/p2/tests/sharedinstall/SharedProfilePreferencesTest.java @@ -48,7 +48,7 @@ public class SharedProfilePreferencesTest extends AbstractProvisioningTest { } protected void setUp() throws Exception { - super.setUp(); + //We don't call super.setUp() on purpose Bundle p2Core = Platform.getBundle("org.eclipse.equinox.p2.core"); p2Core.stop(); @@ -58,6 +58,7 @@ public class SharedProfilePreferencesTest extends AbstractProvisioningTest { 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"); + System.setProperty("eclipse.p2.data.area", "@config.dir/../p2"); p2Core.start(); } @@ -66,7 +67,7 @@ public class SharedProfilePreferencesTest extends AbstractProvisioningTest { IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(TestActivator.getContext(), IPreferencesService.class.getName()); assertNotNull(prefService); try { - URI defaultLocation = URIUtil.fromString(TestActivator.getContext().getProperty("osgi.configuration.area") + "/p2/"); + URI defaultLocation = URIUtil.makeAbsolute(URIUtil.fromString(TestActivator.getContext().getProperty("osgi.configuration.area") + "../p2/"), new URI(".")); String locationString = EncodingUtils.encodeSlashes(defaultLocation.toString()); Preferences node = prefService.getRootNode().node("/profile/shared/" + locationString + "/_SELF_/org.eclipse.equinox.p2.metadata.repository/repositories"); //$NON-NLS-1$ String[] children = node.childrenNames(); @@ -81,4 +82,12 @@ public class SharedProfilePreferencesTest extends AbstractProvisioningTest { } + +// public void testCountRepoInSharedInstallThroughRepoManagerAPI() { +// IMetadataRepositoryManager repoMgr = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME); +// URI[] repos = repoMgr.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL); +// assertEquals(3, repos.length); +// } + + } diff --git a/bundles/org.eclipse.equinox.p2.tests.sharedinstall/testData/sharedPreferences/userHome/configuration/p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs b/bundles/org.eclipse.equinox.p2.tests.sharedinstall/testData/sharedPreferences/userHome/configuration/p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs deleted file mode 100644 index dd3534dbf..000000000 --- a/bundles/org.eclipse.equinox.p2.tests.sharedinstall/testData/sharedPreferences/userHome/configuration/p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -repositories/http\:__download.eclipse.org_eclipse_updates_4.2/enabled=true -repositories/http\:__download.eclipse.org_eclipse_updates_4.2/isSystem=false -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/enabled=true -repositories/http\:__download.eclipse.org_mylyn_releases_juno/isSystem=false -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/enabled=true -repositories/http\:__download.eclipse.org_releases_juno/isSystem=false -repositories/http\:__download.eclipse.org_releases_juno/nickname=Juno -repositories/http\:__download.eclipse.org_releases_juno/uri=http\://download.eclipse.org/releases/juno -- cgit v1.2.3