Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-07-10 16:27:29 +0000
committerPascal Rapicault2012-07-10 16:27:29 +0000
commite6ed13212ea5c1a7daaf8f9d52f5a885b0929e1f (patch)
tree06232a07ecf91a909e435c556442047768299802 /bundles/org.eclipse.equinox.p2.tests
parentffeddcac921157a66d827325325ce5fbde418ff7 (diff)
downloadrt.equinox.p2-e6ed13212ea5c1a7daaf8f9d52f5a885b0929e1f.tar.gz
rt.equinox.p2-e6ed13212ea5c1a7daaf8f9d52f5a885b0929e1f.tar.xz
rt.equinox.p2-e6ed13212ea5c1a7daaf8f9d52f5a885b0929e1f.zip
Bug 384753 - [publisher] support for p2ql in update descriptor v20120710-162729
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-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