diff options
author | Krzysztof Daniel | 2013-11-27 09:51:08 +0000 |
---|---|---|
committer | Krzysztof Daniel | 2013-11-27 09:51:08 +0000 |
commit | 10bcad986a10632b52b9d8ef868bae3a739d7c87 (patch) | |
tree | 1a03a53434699cf1ae98e342fa879a844ed80c58 | |
parent | b776de6fdad40421ca9cd722994137137a643498 (diff) | |
download | rt.equinox.p2-10bcad986a10632b52b9d8ef868bae3a739d7c87.tar.gz rt.equinox.p2-10bcad986a10632b52b9d8ef868bae3a739d7c87.tar.xz rt.equinox.p2-10bcad986a10632b52b9d8ef868bae3a739d7c87.zip |
bug 422043 - 7 ConfigurationTests failed in official build
Use canonical paths also when iterating over the sites.
Change-Id: I99dc527bc9e8f8f9368d735c87c2eea5ee577c5f
Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
2 files changed, 12 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java index c9d750d15..45f2413f5 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java @@ -12,8 +12,7 @@ package org.eclipse.equinox.p2.tests.reconciler.dropins; import java.io.*; -import java.net.MalformedURLException; -import java.net.URL; +import java.net.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.frameworkadmin.BundleInfo; @@ -496,14 +495,15 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest { * Iterate over the sites in the given configuration and remove the one which * has a url matching the given location. */ - public boolean removeSite(Configuration configuration, String location) { + public boolean removeSite(Configuration configuration, String location) throws IOException, URISyntaxException { System.out.println("remove site location = " + location); - IPath path = new Path(location); + File left = new File(new URI(location)).getCanonicalFile(); List sites = configuration.getSites(); for (Iterator iter = sites.iterator(); iter.hasNext();) { Site tempSite = (Site) iter.next(); String siteURL = tempSite.getUrl(); - if (path.equals(new Path(siteURL))) { + File right = new File(new URI(siteURL)).getCanonicalFile(); + if (left.equals(right)) { System.out.println("Match " + siteURL); boolean result = configuration.removeSite(tempSite); System.out.println("removed " + result); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ConfigurationTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ConfigurationTests.java index d28f56cbc..9b487a7c3 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ConfigurationTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ConfigurationTests.java @@ -12,6 +12,7 @@ package org.eclipse.equinox.p2.tests.reconciler.dropins; import java.io.File; import java.io.IOException; +import java.net.URISyntaxException; import java.util.Iterator; import junit.framework.Test; import junit.framework.TestSuite; @@ -87,7 +88,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * Test discovering a site in a platform.xml file and installing the bundles from it. * Then change the site to be disabled and then re-reconcile. */ - public void testSiteEnabled() throws IOException { + public void testSiteEnabled() throws IOException, URISyntaxException { assertInitialized(); System.out.println(">>> testSiteEnabled " + output); File temp = getTempFolder(); @@ -144,7 +145,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * a sub-element of the site. When the feature and its plug-ins are removed * from the site we need to ensure the plug-ins are removed from the install. */ - public void test_247095() throws IOException { + public void test_247095() throws IOException, URISyntaxException { assertInitialized(); System.out.println(">>> test_247095 " + output); Configuration configuration = getConfiguration(); @@ -202,7 +203,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * Same but delete the files from disk. (other test cases doesn't delete the files... simulates * the use of a shared bundle pool) */ - public void test_247095b() throws IOException { + public void test_247095b() throws IOException, URISyntaxException { assertInitialized(); Configuration configuration = getConfiguration(); File temp = getTempFolder(); @@ -262,7 +263,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * features, we were always adding the features to the excludes list and * therefore they were never installed. */ - public void test_249607() throws IOException { + public void test_249607() throws IOException, URISyntaxException { assertInitialized(); Configuration configuration = getConfiguration(); File temp = getTempFolder(); @@ -303,7 +304,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * Add a site to the platform.xml, reconcile, ensure its contents are installed, remove the site, * reconcile, ensure the contents are uninstalled. */ - public void test_249898() throws IOException { + public void test_249898() throws IOException, URISyntaxException { assertInitialized(); Configuration configuration = getConfiguration(); File temp = getTempFolder(); @@ -402,7 +403,7 @@ public class ConfigurationTests extends AbstractReconcilerTest { * Add a new site to the platform.xml file which points to a location that contains * a p2 repository. (content.jar and artifacts.jar + bundles) */ - public void test_p2Site() { + public void test_p2Site() throws IOException, URISyntaxException { assertInitialized(); // initial reconciliation to create platform.xml |