diff options
author | Tobias Oberlies | 2015-02-11 18:07:56 +0000 |
---|---|---|
committer | Tobias Oberlies | 2015-02-16 08:29:50 +0000 |
commit | c3cdccddfd6fb7b164b216b605252b718004f6c3 (patch) | |
tree | cb968c68bc2aeeb37a691475275cf9c21dc6d3fa /bundles/org.eclipse.equinox.p2.tests | |
parent | ac896028a4cc69551aa137135fce3c06642016d5 (diff) | |
download | rt.equinox.p2-c3cdccddfd6fb7b164b216b605252b718004f6c3.tar.gz rt.equinox.p2-c3cdccddfd6fb7b164b216b605252b718004f6c3.tar.xz rt.equinox.p2-c3cdccddfd6fb7b164b216b605252b718004f6c3.zip |
373817 Add hasBundles and hasFeatures methods
... so that the check for ignored product file content does not call
getBundles and getFeatures. This makes it easier to override the latter
methods to also expand version references with 'qualifier' literals.
Bug: 373817
Change-Id: I18591dfe5b8abd014889374b22686501d0173ef4
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
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> |