Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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/ProductFileTest.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyBundles.product20
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFeatures.product20
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFragments.product20
4 files changed, 81 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java
index 8ec7a5fb5..7c0c36402 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java
@@ -137,6 +137,27 @@ public class ProductFileTest extends TestCase {
assertThat(rootFeaturesProduct.getFeatures(), is(rootFeaturesProduct.getFeatures(IProductDescriptor.INCLUDED_FEATURES)));
}
+ public void testHasFeatures() throws Exception {
+ ProductFile featuresOnly = new ProductFile(TestData.getFile("ProductActionTest", "onlyFeatures.product").toString());
+ assertThat(featuresOnly.hasFeatures(), is(true));
+ assertThat(featuresOnly.hasBundles(false), is(false));
+ assertThat(featuresOnly.hasBundles(true), is(false));
+ }
+
+ public void testHasBundles() throws Exception {
+ ProductFile bundlesOnly = new ProductFile(TestData.getFile("ProductActionTest", "onlyBundles.product").toString());
+ assertThat(bundlesOnly.hasFeatures(), is(false));
+ assertThat(bundlesOnly.hasBundles(false), is(true));
+ assertThat(bundlesOnly.hasBundles(true), is(true));
+ }
+
+ public void testHasFragments() throws Exception {
+ ProductFile bundlesOnly = new ProductFile(TestData.getFile("ProductActionTest", "onlyFragments.product").toString());
+ assertThat(bundlesOnly.hasFeatures(), is(false));
+ assertThat(bundlesOnly.hasBundles(false), is(false));
+ assertThat(bundlesOnly.hasBundles(true), is(true));
+ }
+
/**
* Test method for {@link org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile#getIcons(java.lang.String)}.
*/
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyBundles.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyBundles.product
new file mode 100644
index 000000000..618127834
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyBundles.product
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product uid="product.with.plugin" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <plugins>
+ <plugin id="org.eclipse.core.commands"/>
+ </plugins>
+
+ <features>
+ </features>
+
+</product>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFeatures.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFeatures.product
new file mode 100644
index 000000000..1fc92b22c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFeatures.product
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product uid="product.with.feature" useFeatures="true" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="org.eclipse.rcp"/>
+ </features>
+
+</product>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFragments.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFragments.product
new file mode 100644
index 000000000..0c8ae9b35
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/onlyFragments.product
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product uid="product.with.fragment" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+
+ <plugins>
+ <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
+ </plugins>
+
+ <features>
+ </features>
+
+</product>

Back to the top