summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-11-21 08:00:19 (EST)
committerKrzysztof Daniel2013-11-21 08:17:20 (EST)
commit0dae0e98a851cc5644f59ef9945e1217e129462a (patch)
treebeda045c3dbcd34d3b0b5acf4d6cb464ffdbac44
parent89e0dd988ea7152d2efff487a65d3c0e4d512f05 (diff)
downloadrt.equinox.p2-0dae0e98a851cc5644f59ef9945e1217e129462a.zip
rt.equinox.p2-0dae0e98a851cc5644f59ef9945e1217e129462a.tar.gz
rt.equinox.p2-0dae0e98a851cc5644f59ef9945e1217e129462a.tar.bz2
bug 422043 - 7 ConfigurationTests failed in official buildrefs/changes/64/18664/2
Instrumentation to sysout important paths. Also: Improved tests cleaning. Change-Id: Ia9fa1dd1ae6d70e183825bc8dd662f7cc26745ee Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ConfigurationTests.java6
3 files changed, 32 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index c9b6bcb..9b5a35f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -607,11 +607,22 @@ public abstract class AbstractProvisioningTest extends TestCase {
if (!file.exists())
return true;
if (file.isDirectory()) {
+ file.setWritable(true);
+ file.setReadable(true);
+ file.setExecutable(true);
File[] children = file.listFiles();
- for (int i = 0; i < children.length; i++)
- delete(children[i]);
+ for (int i = 0; i < children.length; i++) {
+ if (!delete(children[i])) {
+ System.out.println(">> deleting failed" + children[i]);
+ }
+ }
+ }
+ if (!file.delete()) {
+ file.setWritable(true);
+ file.setReadable(true);
+ file.delete();
}
- return file.delete();
+ return !file.exists();
}
/**
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 8f530f0..0f9c95f 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
@@ -315,7 +315,9 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
}
protected File getBundlesInfo() {
- return new File(output, "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ File file = new File(output, "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info");
+ System.out.println(">>> getBundlesInfo = " + file);
+ return file;
}
public boolean isInBundlesInfo(String bundleId, String version) throws IOException {
@@ -441,9 +443,12 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
return;
for (Iterator iter = toRemove.iterator(); iter.hasNext();) {
File next = (File) iter.next();
- delete(next);
+ if (!delete(next)) {
+ System.out.println("deleting failed!!! " + next);
+ }
}
output = null;
+ System.out.println(">>> removing " + toRemove);
toRemove.clear();
}
@@ -453,6 +458,9 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
public Configuration getConfiguration() {
File configLocation = new File(output, "eclipse/configuration/org.eclipse.update/platform.xml");
File installLocation = new File(output, "eclipse");
+ System.out.println(">>> getConfiguration");
+ System.out.println(" configLocation = " + configLocation);
+ System.out.println(" installLocation = " + installLocation);
return loadConfiguration(configLocation, installLocation);
}
@@ -489,8 +497,10 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
* has a url matching the given location.
*/
public boolean removeSite(Configuration configuration, String location) {
+ System.out.println("remove site=" + location);
IPath path = new Path(location);
List sites = configuration.getSites();
+ System.out.println("sites=" + sites);
for (Iterator iter = sites.iterator(); iter.hasNext();) {
Site tempSite = (Site) iter.next();
String siteURL = tempSite.getUrl();
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 ff70468..319a67c 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
@@ -56,6 +56,7 @@ public class ConfigurationTests extends AbstractReconcilerTest {
public void testDiscoverOne() {
// copy feature and bundle to dropins and reconcile
assertInitialized();
+ System.out.println(">>> testDiscoverOne " + output);
File featureFile = getTestData("2.0", "testData/reconciler/features/myFeature_1.0.0");
add("2.2", "dropins/features", featureFile);
File bundleFile = getTestData("2.3", "testData/reconciler/plugins/myBundle_1.0.0.jar");
@@ -87,10 +88,13 @@ public class ConfigurationTests extends AbstractReconcilerTest {
*/
public void testSiteEnabled() {
assertInitialized();
+ System.out.println(">>> testSiteEnabled " + output);
File temp = getTempFolder();
+ System.out.println(" temp folder location = " + temp);
toRemove.add(temp);
Configuration configuration = getConfiguration();
String siteLocation = new File(temp, "eclipse").toURI().toString();
+ System.out.println(" site location = " + siteLocation);
File source = getTestData("2.0", "testData/reconciler/ext.jar");
copy("2.1", source, temp);
@@ -141,9 +145,11 @@ public class ConfigurationTests extends AbstractReconcilerTest {
*/
public void test_247095() {
assertInitialized();
+ System.out.println(">>> test_247095 " + output);
Configuration configuration = getConfiguration();
File temp = getTempFolder();
toRemove.add(temp);
+ System.out.println(" temp=" + temp);
String siteLocation = null;
siteLocation = new File(temp, "eclipse").toURI().toString();