Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
index 1325f96fb..9c752ba85 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java
@@ -85,6 +85,28 @@ public class AdviceFileParserTest extends TestCase {
assertEquals("Test Description", updateDescriptor.getDescription());
}
+ public void testUpdateDescriptorWithMatch() {
+ Map map = new HashMap();
+ map.put("update.match", "providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'B' || pc.name == 'C'))");
+ map.put("update.severity", "10");
+ map.put("update.description", "Test Description");
+
+ AdviceFileParser parser = new AdviceFileParser("id", Version.parseVersion("9.10.11"), map);
+ parser.parse();
+
+ IUpdateDescriptor updateDescriptor = parser.getUpdateDescriptor();
+ assertEquals("Test Description", updateDescriptor.getDescription());
+ assertEquals(10, updateDescriptor.getSeverity());
+ //Here we test that the extraction of the name fails since this is not of an appropriate format
+ boolean exceptionRaised = false;
+ try {
+ RequiredCapability.extractName(updateDescriptor.getIUsBeingUpdated().iterator().next());
+ } catch (IllegalArgumentException e) {
+ exceptionRaised = true;
+ }
+ assertTrue(exceptionRaised);
+ }
+
public void testUpdateDescriptorAdviceDefaultBound2() {
Map map = new HashMap();
map.put("update.id", "testName");

Back to the top