Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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