Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-07-24 17:32:48 -0400
committerKarsten Thoms2017-07-24 17:32:48 -0400
commit2e3bdf6efb226633c546d2cfd6c389f31fcb30a0 (patch)
tree491de983862991a624f184fc5c288b1fdf054c5b
parent6dec9de838b5275227f481357a2b287c8d19a9a1 (diff)
downloadrt.equinox.p2-2e3bdf6efb226633c546d2cfd6c389f31fcb30a0.tar.gz
rt.equinox.p2-2e3bdf6efb226633c546d2cfd6c389f31fcb30a0.tar.xz
rt.equinox.p2-2e3bdf6efb226633c546d2cfd6c389f31fcb30a0.zip
Bug 514885 - Added test case for match type greaterOrEqualI20170725-2000
Change-Id: I53d9fc1e6ae314d21b76558700d913d344d12eb6 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
index 5c09cb967..f06363cb7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java
@@ -126,6 +126,38 @@ public class FeaturesActionTest extends ActionTest {
}
}
+ public void testMatchGreaterOrEqual() throws Exception {
+ File testFolder = getTestFolder("FeaturesAction.testFilters");
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<feature id=\"test.feature\" version=\"1.0.0\" > \n");
+ buffer.append(" <requires> \n");
+ buffer.append(" <import plugin=\"org.plug\" version=\"1.0.0\" match=\"greaterOrEqual\" /> \n");
+ buffer.append(" <import feature=\"org.foo\" version=\"1.0.0\" match=\"greaterOrEqual\" /> \n");
+ buffer.append(" </requires> \n");
+ buffer.append("</feature> \n");
+ File featureXML = new File(testFolder, "feature.xml");
+ writeBuffer(featureXML, buffer);
+
+ publisherInfo = new PublisherInfo();
+ FeaturesAction action = new FeaturesAction(new File[] {testFolder});
+ action.perform(publisherInfo, publisherResult, new NullProgressMonitor());
+
+ IInstallableUnit iu = publisherResult.getIU("test.feature.feature.group", Version.parseVersion("1.0.0"), null);
+ Collection<IRequirement> requires = iu.getRequirements();
+ assertEquals(3, requires.size());
+ for (IRequirement require : requires) {
+ if (((IRequiredCapability) require).getName().equals("org.foo.feature.group")) {
+ IMatchExpression<IInstallableUnit> matches = require.getMatches();
+ assertEquals("providedCapabilities.exists(x | x.name == $0 && x.namespace == $1 && x.version >= $2)", matches.toString());
+ assertEquals(Version.parseVersion("1.0.0"), matches.getParameters()[2]);
+ } else if (((IRequiredCapability) require).getName().equals("org.plug")) {
+ IMatchExpression<IInstallableUnit> matches = require.getMatches();
+ assertEquals("providedCapabilities.exists(x | x.name == $0 && x.namespace == $1 && x.version >= $2)", matches.toString());
+ assertEquals(Version.parseVersion("1.0.0"), matches.getParameters()[2]);
+ }
+ }
+ }
+
public void testFilters() throws Exception {
File testFolder = getTestFolder("FeaturesAction.testFilters");
StringBuffer buffer = new StringBuffer();

Back to the top