Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-12-02 22:21:10 +0000
committerAndrew Niefer2009-12-02 22:21:10 +0000
commit9f10ff2786dc41c6d4a91ef17a7e7e114d7d2b31 (patch)
tree73e6e853f84638a1ea21e584de8d493c702c8c42 /bundles
parent75f9c4bdfe18db3748bcf37a2a1d63285557754c (diff)
downloadrt.equinox.p2-9f10ff2786dc41c6d4a91ef17a7e7e114d7d2b31.tar.gz
rt.equinox.p2-9f10ff2786dc41c6d4a91ef17a7e7e114d7d2b31.tar.xz
rt.equinox.p2-9f10ff2786dc41c6d4a91ef17a7e7e114d7d2b31.zip
Bug 296558 - Wrong version attribute for the self provided capability of a category IU
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java2
2 files changed, 9 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
index 1a9d09f03..71bc55d14 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.internal.provisional.p2.metadata.IProvidedCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.RepositoryReference;
@@ -54,8 +55,14 @@ public class SiteXMLActionTest extends AbstractProvisioningTest {
Iterator iter = results.iterator();
while (iter.hasNext()) {
IInstallableUnit unit = (IInstallableUnit) iter.next();
- assertTrue("1.0", unit.getId().startsWith(URIUtil.toUnencodedString(siteLocation)));
+ String sitelocation = URIUtil.toUnencodedString(siteLocation);
+ assertTrue("1.0", unit.getId().startsWith(sitelocation));
assertEquals("2.0", "Test Category Label", unit.getProperty(IInstallableUnit.PROP_NAME));
+
+ IProvidedCapability[] provided = unit.getProvidedCapabilities();
+ assertEquals(1, provided.length);
+ assertTrue(provided[0].getName().startsWith(sitelocation));
+ assertEquals(provided[0].getVersion(), unit.getVersion());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
index 4d96438d9..2a3fdfc8f 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
@@ -290,7 +290,7 @@ public class SiteXMLAction extends AbstractPublisherAction {
// Create set of provided capabilities
ArrayList providedCapabilities = new ArrayList();
- providedCapabilities.add(PublisherHelper.createSelfCapability(categoryId, Version.emptyVersion));
+ providedCapabilities.add(PublisherHelper.createSelfCapability(categoryId, cat.getVersion()));
Map localizations = category.getLocalizations();
if (localizations != null) {

Back to the top