Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-08-26 19:10:55 +0000
committerAndrew Niefer2009-08-26 19:10:55 +0000
commit3857e9aa964cc8fe33a211c97ac3649d8d6fb981 (patch)
tree38728d214ccbe5f7294278253adcbaea7e307bd1 /bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher
parentb86a88a6f65be18564e256dafa474d455186f6ca (diff)
downloadrt.equinox.p2-3857e9aa964cc8fe33a211c97ac3649d8d6fb981.tar.gz
rt.equinox.p2-3857e9aa964cc8fe33a211c97ac3649d8d6fb981.tar.xz
rt.equinox.p2-3857e9aa964cc8fe33a211c97ac3649d8d6fb981.zip
bug 278588 - custom config without launcher name causes NPE
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java
index cbdaea56a..4943c9228 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java
@@ -199,8 +199,6 @@ public class ProductFileAdviceTest extends AbstractProvisioningTest {
Properties configProperties = new Properties();
configProperties.put("org.eclipse.equinox.simpleconfigurator.configUrl", "file:org.eclipse.equinox.simpleconfigurator/bundles.info");
- configProperties.put("osgi.bundles", "org.eclipse.equinox.simpleconfigurator@1:start");
- writeProperties(new File(rootFolder, "config.ini"), configProperties);
StringBuffer buffer = new StringBuffer();
buffer.append("org.eclipse.equinox.common,3.5.100.v20090817,plugins/org.eclipse.equinox.common_3.5.100.v20090817.jar,2,true\n");
@@ -222,4 +220,38 @@ public class ProductFileAdviceTest extends AbstractProvisioningTest {
}
}
}
+
+ public void testConfigNullLauncher() throws Exception {
+ File root = getTestFolder("configNullLauncher");
+ File testProduct = new File(root, "test.product");
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<product id=\"test.product\" version=\"1\" useFeatures=\"false\"> \n");
+ buffer.append(" <configIni use=\"default\"> \n");
+ buffer.append(" <win32>config.ini</win32> \n");
+ buffer.append(" </configIni> \n");
+ buffer.append(" <plugins> \n");
+ buffer.append(" <plugin id=\"org.eclipse.core.runtime\" version=\"1.0.4\"/> \n");
+ buffer.append(" <plugin id=\"org.eclipse.equinox.simpleconfigurator\" /> \n");
+ buffer.append(" </plugins> \n");
+ buffer.append("</product> \n");
+ writeBuffer(testProduct, buffer);
+
+ Properties configProperties = new Properties();
+ configProperties.put("osgi.bundles", "org.eclipse.equinox.simpleconfigurator@1:start");
+ configProperties.put("eclipse.application", "test.application");
+ configProperties.put("osgi.instance.area.default", "@user.home/workspace");
+ writeProperties(new File(root, "config.ini"), configProperties);
+
+ ProductFile product = new ProductFile(testProduct.getCanonicalPath());
+ ProductFileAdvice advice = new ProductFileAdvice(product, "x86.win32.win32");
+
+ BundleInfo[] bundles = advice.getBundles();
+ assertEquals("bundlers length", 2, bundles.length);
+
+ Properties adviceProperties = advice.getProperties();
+ assertEquals("instance.area.default", "@user.home/workspace", adviceProperties.get("osgi.instance.area.default"));
+ assertEquals("eclipse.application", "test.application", adviceProperties.get("eclipse.application"));
+ assertEquals("eclipse.product", "test.product", adviceProperties.get("eclipse.product"));
+ }
}

Back to the top