summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2012-10-11 05:03:46 (EDT)
committerTobias Oberlies2012-10-11 05:14:00 (EDT)
commit215fa4de1803474efed31be0d5e8357339d0cc59 (patch)
tree4c03b499bc06df58b83f060bdfce80e71c67147f
parent17a359869cee9cba2dfc19fcae795903cba73029 (diff)
downloadrt.equinox.p2-215fa4de1803474efed31be0d5e8357339d0cc59.zip
rt.equinox.p2-215fa4de1803474efed31be0d5e8357339d0cc59.tar.gz
rt.equinox.p2-215fa4de1803474efed31be0d5e8357339d0cc59.tar.bz2
- There has been a suggestion of how to fix non-atomic loading (i.e. implement it in a way that network problems are not silently ignored), so we may keep non-atomic loading as the default. Bug: 356561 Composite repositories ignores errors when loading children (errors are treated like missing children)
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/compositeArtifacts.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/compositeArtifacts.xml)1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/one/artifacts.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/one/artifacts.xml)0
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/three/artifacts.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/three/artifacts.xml)0
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/compositeArtifacts.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/compositeArtifacts.xml)2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/one/artifacts.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/one/artifacts.xml)0
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/compositeContent.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/compositeContent.xml)1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/one/content.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/one/content.xml)0
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/three/content.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/three/content.xml)0
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/compositeContent.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/compositeContent.xml)2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/one/content.xml (renamed from bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/one/content.xml)0
14 files changed, 14 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index 2a87012..e174050 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -40,8 +40,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
public static final String PI_REPOSITORY_TYPE = "compositeArtifactRepository"; //$NON-NLS-1$
static final public String PROP_ATOMIC_LOADING = "p2.atomic.composite.loading"; //$NON-NLS-1$
- // by default, require that all children of a composite can be loaded; default may be changed to enforce old behavior (see bug 356561)
- static final public boolean ATOMIC_LOADING_DEFAULT = !"false".equals(Activator.getContext().getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$//$NON-NLS-2$;
+ static final public boolean ATOMIC_LOADING_DEFAULT = Boolean.parseBoolean(Activator.getContext().getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$
// keep a list of the child URIs. they can be absolute or relative. they may or may not point
// to a valid reachable repo
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
index a1ac236..ff4d5f2 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
@@ -38,8 +38,7 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
static final public String PI_REPOSITORY_TYPE = "compositeMetadataRepository"; //$NON-NLS-1$
static final public String PROP_ATOMIC_LOADING = "p2.atomic.composite.loading"; //$NON-NLS-1$
- // by default, require that all children of a composite can be loaded; default may be changed to enforce old behavior (see bug 356561)
- static final public boolean ATOMIC_LOADING_DEFAULT = !"false".equals(Activator.getContext().getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$//$NON-NLS-2$;
+ static final public boolean ATOMIC_LOADING_DEFAULT = Boolean.parseBoolean(Activator.getContext().getProperty("eclipse.p2.atomic.composite.loading.default")); //$NON-NLS-1$
static final private Integer REPOSITORY_VERSION = new Integer(1);
static final public String XML_EXTENSION = ".xml"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
index 23769f6..0e329b7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
@@ -1386,11 +1386,11 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
IArtifactRepository repo = null;
IArtifactRepositoryManager manager = getArtifactRepositoryManager();
- File repoFile = getTestData("Strict composite with missing child", "/testData/artifactRepo/compositeBadChildren");
+ File repoFile = getTestData("Atomic composite with missing child", "/testData/artifactRepo/composite/missingChild/atomicLoading");
URI correctChildURI = URIUtil.append(repoFile.toURI(), "one");
URI repoURI = repoFile.getAbsoluteFile().toURI();
- File alreadyLoadedChildFile = getTestData("Strict composite with missing child", "/testData/artifactRepo/compositeBadChildren/three");
+ File alreadyLoadedChildFile = getTestData("Atomic composite with missing child", "/testData/artifactRepo/composite/missingChild/atomicLoading/three");
IArtifactRepository alreadyLoadedChild = manager.loadRepository(alreadyLoadedChildFile.toURI(), null);
assertNotNull(alreadyLoadedChild);
URI previouslyAddedChildURI = URIUtil.append(repoFile.toURI(), "three");
@@ -1406,7 +1406,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
}
assertNull(repo);
assertTrue("an exception should have been reported", exception);
- assertFalse("Successfully loaded child should be removed when composite loading mode is set to strict", manager.contains(correctChildURI));
+ assertFalse("Successfully loaded child should be removed when composite loading mode is set to atomic", manager.contains(correctChildURI));
assertTrue("Periously loaded child should remain in repo manager", manager.contains(previouslyAddedChildURI));
}
@@ -1416,7 +1416,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
IArtifactRepository repo = null;
IArtifactRepositoryManager manager = getArtifactRepositoryManager();
- File repoFile = getTestData("Composite with missing child", "/testData/artifactRepo/compositeBadChildrenLenient");
+ File repoFile = getTestData("Composite with missing child", "/testData/artifactRepo/composite/missingChild/nonAtomicLoading");
URI correctChildURI = URIUtil.append(repoFile.toURI(), "one");
assertFalse("Child should not be available in repo manager", manager.contains(correctChildURI));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
index e52d7b4..e01be13 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
@@ -685,11 +685,11 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
IMetadataRepository repo = null;
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- File repoFile = getTestData("Strict composite with missing child", "/testData/metadataRepo/compositeBadChildren");
+ File repoFile = getTestData("Atomic composite with missing child", "/testData/metadataRepo/composite/missingChild/atomicLoading");
URI correctChildURI = URIUtil.append(repoFile.toURI(), "one");
URI repoURI = repoFile.getAbsoluteFile().toURI();
- File alreadyLoadedChildFile = getTestData("Strict composite with missing child", "/testData/metadataRepo/compositeBadChildren/three");
+ File alreadyLoadedChildFile = getTestData("Atomic composite with missing child", "/testData/metadataRepo/composite/missingChild/atomicLoading/three");
IMetadataRepository alreadyLoadedChild = manager.loadRepository(alreadyLoadedChildFile.toURI(), null);
assertNotNull(alreadyLoadedChild);
URI previouslyAddedChildURI = URIUtil.append(repoFile.toURI(), "three");
@@ -705,7 +705,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
}
assertNull(repo);
assertTrue("an exception should have been reported", exception);
- assertFalse("Successfully loaded child should be removed when composite loading mode is set to strict", manager.contains(correctChildURI));
+ assertFalse("Successfully loaded child should be removed when composite loading mode is set to atomic", manager.contains(correctChildURI));
assertTrue("Periously loaded child should remain in repo manager", manager.contains(previouslyAddedChildURI));
}
@@ -715,7 +715,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
IMetadataRepository repo = null;
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- File repoFile = getTestData("Composite with missing child", "/testData/metadataRepo/compositeBadChildrenLenient");
+ File repoFile = getTestData("Composite with missing child", "/testData/metadataRepo/composite/missingChild/nonAtomicLoading");
URI correctChildURI = URIUtil.append(repoFile.toURI(), "one");
assertFalse("Child should not be available in repo manager", manager.contains(correctChildURI));
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/compositeArtifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/compositeArtifacts.xml
index 72be2b0..8b544da 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/compositeArtifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/compositeArtifacts.xml
@@ -4,6 +4,7 @@
<properties size='2'>
<property name='p2.compressed' value='false'/>
<property name='p2.timestamp' value='1234'/>
+ <property name='p2.atomic.composite.loading' value='true'/>
</properties>
<children size='3'>
<child location='one'/>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/one/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/one/artifacts.xml
index 19e55d7..19e55d7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/one/artifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/one/artifacts.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/three/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/three/artifacts.xml
index 6c73323..6c73323 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildren/three/artifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/atomicLoading/three/artifacts.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/compositeArtifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/compositeArtifacts.xml
index e798958..cacef3f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/compositeArtifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/compositeArtifacts.xml
@@ -4,7 +4,7 @@
<properties size='2'>
<property name='p2.compressed' value='false'/>
<property name='p2.timestamp' value='1234'/>
- <property name='p2.atomic.composite.loading' value='false'/>
+ <!-- this is the default: <property name='p2.atomic.composite.loading' value='false'/> -->
</properties>
<children size='2'>
<child location='one'/>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/one/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/one/artifacts.xml
index 19e55d7..19e55d7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/compositeBadChildrenLenient/one/artifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/artifactRepo/composite/missingChild/nonAtomicLoading/one/artifacts.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/compositeContent.xml b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/compositeContent.xml
index 1d2b887..4209828 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/compositeContent.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/compositeContent.xml
@@ -4,6 +4,7 @@
<properties size='2'>
<property name='p2.compressed' value='false'/>
<property name='p2.timestamp' value='1234'/>
+ <property name='p2.atomic.composite.loading' value='true'/>
</properties>
<children size='3'>
<child location='one'/>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/one/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/one/content.xml
index 41f172f..41f172f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/one/content.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/one/content.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/three/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/three/content.xml
index 41f172f..41f172f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildren/three/content.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/atomicLoading/three/content.xml
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/compositeContent.xml b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/compositeContent.xml
index a4e2588..0b3e794 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/compositeContent.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/compositeContent.xml
@@ -4,7 +4,7 @@
<properties size='2'>
<property name='p2.compressed' value='false'/>
<property name='p2.timestamp' value='1234'/>
- <property name='p2.atomic.composite.loading' value='false'/>
+ <!-- this is the default: <property name='p2.atomic.composite.loading' value='false'/> -->
</properties>
<children size='2'>
<child location='one'/>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/one/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/one/content.xml
index 41f172f..41f172f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/compositeBadChildrenLenient/one/content.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/metadataRepo/composite/missingChild/nonAtomicLoading/one/content.xml