Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2008-05-01 15:25:49 +0000
committerDJ Houghton2008-05-01 15:25:49 +0000
commitf2c26d223b2c255dff311b437deee924719279b9 (patch)
treece70472bb12773d899966bcad9859377dc40c02a /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation
parent21fd65da1a70ffe9c148ebfa588a57fb280b826f (diff)
downloadrt.equinox.p2-f2c26d223b2c255dff311b437deee924719279b9.tar.gz
rt.equinox.p2-f2c26d223b2c255dff311b437deee924719279b9.tar.xz
rt.equinox.p2-f2c26d223b2c255dff311b437deee924719279b9.zip
Bug 229641 - Added Extension location repos in UI contain no features
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationArtifactRepositoryFactoryTest.java53
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/extensionlocation/ExtensionLocationMetadataRepositoryFactoryTest.java43
2 files changed, 32 insertions, 64 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 bce748dfe..f78f48dc7 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
@@ -15,7 +15,6 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepository;
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;
@@ -96,12 +95,13 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
directory.mkdirs();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
} catch (MalformedURLException e) {
fail("0.99", e);
}
+ fail("1.0");
}
public void testEmptyFeatureAndPluginsDirectory() {
@@ -111,9 +111,8 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
new File(directory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ fail("0.1", e);
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -125,9 +124,8 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
new File(directory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ fail("0.1", e);
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -139,9 +137,8 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
new File(directory, "plugins").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ fail("0.1", e);
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -156,9 +153,8 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
new File(eclipseDirectory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ fail("0.1", e);
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -173,12 +169,13 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
new File(eclipseDirectory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- assertEquals("0.5", ProvisionException.REPOSITORY_NOT_FOUND, e.getStatus().getCode());
+ if (e.getStatus().getCode() == ProvisionException.REPOSITORY_NOT_FOUND)
+ return;
} catch (MalformedURLException e) {
fail("0.99", e);
}
+ fail("1.0");
}
public void testNormalFeaturesandPluginsDirectory() {
@@ -187,17 +184,13 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
try {
URL location = directory.toURL();
- IArtifactRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalFeaturesandPluginsDirectory", ExtensionLocationArtifactRepository.TYPE, null);
+ IArtifactRepository repo = factory.load(location, getMonitor());
if (repo.getArtifactKeys().length != 2)
fail("2.1");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("3.5");
} catch (MalformedURLException e) {
fail("3.99", e);
}
@@ -211,17 +204,13 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation/features"), features);
try {
URL location = directory.toURL();
- IArtifactRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalFeaturesDirectory", ExtensionLocationArtifactRepository.TYPE, null);
+ IArtifactRepository repo = factory.load(location, getMonitor());
if (repo.getArtifactKeys().length != 1)
fail("2.1");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("3.5", e);
} catch (MalformedURLException e) {
fail("3.99", e);
}
@@ -235,17 +224,13 @@ public class ExtensionLocationArtifactRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation/plugins"), plugins);
try {
URL location = directory.toURL();
- IArtifactRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalFeaturesDirectory", ExtensionLocationArtifactRepository.TYPE, null);
+ IArtifactRepository repo = factory.load(location, getMonitor());
if (repo.getArtifactKeys().length != 1)
fail("2.1");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("3.5", e);
} catch (MalformedURLException e) {
fail("3.99", e);
}
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 01d496bf1..2892ef58f 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
@@ -14,7 +14,6 @@ import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepository;
import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepositoryFactory;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
@@ -105,9 +104,8 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
new File(directory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- // expected
+ fail("0.1");
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -119,9 +117,8 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
new File(directory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- // expected
+ fail("0.1");
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -133,9 +130,8 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
new File(directory, "plugins").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- // expected
+ fail("0.1");
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -150,9 +146,8 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
new File(eclipseDirectory, "features").mkdir();
try {
factory.load(directory.toURL(), getMonitor());
- fail("0.1");
} catch (ProvisionException e) {
- // expected
+ fail("0.1");
} catch (MalformedURLException e) {
fail("0.99", e);
}
@@ -181,17 +176,13 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation"), directory);
try {
URL location = directory.toURL();
- IMetadataRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalFeaturesandPluginsDirectory", ExtensionLocationMetadataRepository.TYPE, null);
+ IMetadataRepository repo = factory.load(location, getMonitor());
if (repo.query(InstallableUnitQuery.ANY, new Collector(), null).toCollection().size() != 3)
fail("2.99");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("3.99");
} catch (MalformedURLException e) {
fail("4.99", e);
}
@@ -205,17 +196,13 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation/features"), features);
try {
URL location = directory.toURL();
- IMetadataRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalFeaturesDirectory", ExtensionLocationMetadataRepository.TYPE, null);
+ IMetadataRepository repo = factory.load(location, getMonitor());
if (repo.query(InstallableUnitQuery.ANY, new Collector(), null).toCollection().size() != 2)
fail("3.0");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("4.0");
} catch (MalformedURLException e) {
fail("4.99", e);
}
@@ -229,17 +216,13 @@ public class ExtensionLocationMetadataRepositoryFactoryTest extends AbstractProv
copy("1.0", getTestData("1.1", "/testData/extensionlocation/plugins"), plugins);
try {
URL location = directory.toURL();
- IMetadataRepository repo = null;
try {
- repo = factory.load(location, getMonitor());
- fail("2.0");
- } catch (ProvisionException ex) {
- repo = factory.create(location, "testNormalPluginsDirectory", ExtensionLocationMetadataRepository.TYPE, null);
+ IMetadataRepository repo = factory.load(location, getMonitor());
if (repo.query(InstallableUnitQuery.ANY, new Collector(), null).toCollection().size() != 1)
fail("3.0");
+ } catch (ProvisionException ex) {
+ fail("2.0");
}
- } catch (ProvisionException e) {
- fail("4.0");
} catch (MalformedURLException e) {
fail("4.99", e);
}

Back to the top