Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-04-20 18:45:50 -0400
committerspingel2010-04-20 18:45:50 -0400
commitf87dc37c1844e17dcfb54bb97b5f2aabef1af068 (patch)
tree1166421f12aeef4257867a24de9d851cd3143191 /bundles/org.eclipse.equinox.p2.tests.discovery
parentce9742d62261b96f9aaa0e9b91a9ff4f059a7582 (diff)
downloadrt.equinox.p2-f87dc37c1844e17dcfb54bb97b5f2aabef1af068.tar.gz
rt.equinox.p2-f87dc37c1844e17dcfb54bb97b5f2aabef1af068.tar.xz
rt.equinox.p2-f87dc37c1844e17dcfb54bb97b5f2aabef1af068.zip
bug 309873 - [discovery] allow arbitrary tags to be specified in bundle catalogs
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.discovery')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/plugin.xml18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java1
4 files changed, 30 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/plugin.xml b/bundles/org.eclipse.equinox.p2.tests.discovery/plugin.xml
index 06a344de3..61fed3bf0 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/plugin.xml
@@ -30,7 +30,7 @@
</connectorDescriptor>
<connectorDescriptor
categoryId="org.eclipse.mylyn.discovery.tests.connectorCategory1"
- description="Trac Connector"
+ description="Connector with id org.eclipse.mylyn.discovery.test1"
id="org.eclipse.mylyn.discovery.test1"
kind="task"
license="License"
@@ -40,7 +40,7 @@
</connectorDescriptor>
<connectorDescriptor
categoryId="org.eclipse.mylyn.discovery.tests.connectorCategory1"
- description="Trac Connector"
+ description="Connector with id org.eclipse.mylyn.discovery.2tests"
id="org.eclipse.mylyn.discovery.2tests"
kind="task"
license="License"
@@ -62,6 +62,16 @@
%certification.description
</description>
</certification>
+ <connectorDescriptor
+ categoryId="org.eclipse.mylyn.discovery.tests.connectorCategory1"
+ description="Tagged as Custom"
+ id="org.eclipse.mylyn.discovery.test.tagged"
+ kind="Custom"
+ license="License"
+ name="Tagged Connector"
+ provider="Eclipse Mylyn"
+ siteUrl="http://localhost/discovery/">
+ </connectorDescriptor>
</extension>
<extension
point="org.eclipse.ui.menus">
@@ -75,6 +85,10 @@
name="org.eclipse.equinox.p2.ui.discovery.commands.DirectoryParameter"
value="http://www.eclipse.org/mylyn/discovery/directory-3.3.xml">
</parameter>
+ <parameter
+ name="org.eclipse.equinox.p2.ui.discovery.commands.TagsParameter"
+ value="document=Documents,task=Tasks,vcs=Version Control">
+ </parameter>
</command>
<command
commandId="org.eclipse.equinox.p2.ui.discovery.commands.ShowRepositoryCatalog"
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
index f7295c4b1..a01039556 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/AllDiscoveryTests.java
@@ -21,7 +21,7 @@ import org.eclipse.equinox.p2.discovery.tests.core.*;
public class AllDiscoveryTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for org.eclipse.mylyn.discovery"); //$NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for org.eclipse.equinox.p2.discovery.tests"); //$NON-NLS-1$
suite.addTestSuite(ConnectorDiscoveryTest.class);
suite.addTestSuite(DirectoryParserTest.class);
suite.addTestSuite(BundleDiscoveryStrategyTest.class);
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
index cc130de25..7364fd188 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/BundleDiscoveryStrategyTest.java
@@ -11,8 +11,7 @@
package org.eclipse.equinox.p2.discovery.tests.core;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import junit.framework.TestCase;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -33,6 +32,8 @@ public class BundleDiscoveryStrategyTest extends TestCase {
private final List<Certification> certifications = new ArrayList<Certification>();
+ private final List<Tag> tags = new ArrayList();
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -41,6 +42,7 @@ public class BundleDiscoveryStrategyTest extends TestCase {
discoveryStrategy.setCategories(categories);
discoveryStrategy.setItems(connectors);
discoveryStrategy.setCertifications(certifications);
+ discoveryStrategy.setTags(tags);
}
public void testDiscovery() throws CoreException {
@@ -56,6 +58,14 @@ public class BundleDiscoveryStrategyTest extends TestCase {
assertNotNull(certification);
}
+ public void testCustomTag() throws CoreException {
+ discoveryStrategy.performDiscovery(new NullProgressMonitor());
+
+ CatalogItem connector = findConnectorById("org.eclipse.mylyn.discovery.test.tagged");
+ assertEquals(new HashSet<Tag>(Arrays.asList(new Tag("Custom", "Custom"))), connector.getTags());
+ assertEquals(Arrays.asList(new Tag("task", "Tasks"), new Tag("Custom", "Custom")), discoveryStrategy.getTags());
+ }
+
public void testDiscoveryNoCategoriesPolicy() throws CoreException {
discoveryStrategy.setPolicy(new Policy(false));
discoveryStrategy.performDiscovery(new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
index 06482af5f..8082177c7 100644
--- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java
@@ -35,6 +35,7 @@ public class RemoteBundleDiscoveryStrategyTest extends TestCase {
discoveryStrategy.setCategories(new ArrayList<CatalogCategory>());
discoveryStrategy.setItems(new ArrayList<CatalogItem>());
discoveryStrategy.setCertifications(new ArrayList<Certification>());
+ discoveryStrategy.setTags(new ArrayList<Tag>());
}
public void testPerformDiscovery() throws CoreException, IOException {

Back to the top