Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2009-03-05 18:58:27 +0000
committerSimon Kaegi2009-03-05 18:58:27 +0000
commit629320b0541b20395ec56fef0ac20e2e155591f8 (patch)
treef459365ce98c29e50f0a64431dac9eba65a334ce /bundles/org.eclipse.equinox.p2.tests/src
parentf7a93f6d6307542e9bf3abdc72550279a23da88e (diff)
downloadrt.equinox.p2-629320b0541b20395ec56fef0ac20e2e155591f8.tar.gz
rt.equinox.p2-629320b0541b20395ec56fef0ac20e2e155591f8.tar.xz
rt.equinox.p2-629320b0541b20395ec56fef0ac20e2e155591f8.zip
Bug 252752 [dropins] Exported repository not recognized as p2 repo
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java4
3 files changed, 175 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java
index 40537afcd..749f74268 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java
@@ -14,6 +14,7 @@ import java.io.File;
import java.io.IOException;
import java.net.*;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.equinox.internal.p2.extensionlocation.Constants;
import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepositoryFactory;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
@@ -258,4 +259,90 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
}
fail("1.0");
}
+
+ public void testArtifactsXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File artifactsXML = new File(directory, "artifacts.xml");
+ artifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testArtifactsXMLFeaturesandPluginsDirectoryWithExtensionLocation() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File artifactsXML = new File(directory, "artifacts.xml");
+ artifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ File extensionLocation = new File(tempDirectory.getAbsolutePath() + Constants.EXTENSION_LOCATION);
+ URI location = extensionLocation.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testContentXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File contentXML = new File(directory, "content.xml");
+ contentXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testCompositeArtifactsXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File compositeArtifactsXML = new File(directory, "compositeArtifacts.xml");
+ compositeArtifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testCompositeContentXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File compositeContentXML = new File(directory, "compositeContent.xml");
+ compositeContentXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
index bf4a0230f..9478939f1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java
@@ -13,6 +13,7 @@ package org.eclipse.equinox.p2.tests.extensionlocation;
import java.io.File;
import java.io.IOException;
import java.net.*;
+import org.eclipse.equinox.internal.p2.extensionlocation.Constants;
import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepositoryFactory;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepositoryManager;
@@ -250,4 +251,90 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
}
fail("1.0");
}
+
+ public void testArtifactsXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File artifactsXML = new File(directory, "artifacts.xml");
+ artifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testArtifactsXMLFeaturesandPluginsDirectoryWithExtensionLocation() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File artifactsXML = new File(directory, "artifacts.xml");
+ artifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ File extensionLocation = new File(tempDirectory.getAbsolutePath() + Constants.EXTENSION_LOCATION);
+ URI location = extensionLocation.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testContentXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File contentXML = new File(directory, "content.xml");
+ contentXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testCompositeArtifactsXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File compositeArtifactsXML = new File(directory, "compositeArtifacts.xml");
+ compositeArtifactsXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
+
+ public void testCompositeContentXMLFeaturesandPluginsDirectory() throws IOException {
+ File directory = new File(tempDirectory, "exists");
+ directory.mkdirs();
+ File compositeContentXML = new File(directory, "compositeContent.xml");
+ compositeContentXML.createNewFile();
+
+ copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
+ URI location = directory.toURI();
+ try {
+ factory.load(location, 0, getMonitor());
+ } catch (ProvisionException e) {
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
+ }
+ fail("1.0");
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
index 5a6c13834..b98394ce7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
@@ -53,9 +53,7 @@ public class BasicTests extends AbstractReconcilerTest {
suite.addTest(new BasicTests("testSingleton"));
suite.addTest(new BasicTests("testDirectoryBasedPlugin"));
suite.addTest(new BasicTests("testSimpleRepoWithSiteXMLPlaceHolder"));
- // NOTE: Enable this tests when we can handle a simple repo without the site.xml placeholder
- // see bug 252752
- //suite.addTest(new BasicTests("testSimpleRepo"));
+ suite.addTest(new BasicTests("testSimpleRepo"));
// suite.addTest(new BasicTests("test_251167"));
// suite.addTest(new BasicTests("test_p2Repo"));

Back to the top