diff options
author | Thomas Watson | 2016-07-13 14:23:45 +0000 |
---|---|---|
committer | Thomas Watson | 2016-07-13 14:23:45 +0000 |
commit | 90a8f7255361798ed19fd41ab6c7df2e76b6630d (patch) | |
tree | 96492c640eea68e11144bfca5445e72eb41fcda5 | |
parent | 344976e2eadd16579efd04b0a563b42d96726316 (diff) | |
download | rt.equinox.framework-I20160803-2000.tar.gz rt.equinox.framework-I20160803-2000.tar.xz rt.equinox.framework-I20160803-2000.zip |
Bug 486952 - [osgi R7] set org.osgi.framework.storage property whenY20160811-1000Y20160804-1000Y20160728-1000Y20160721-1000Y20160714-1000I20160809-1300I20160809-1100I20160803-2000I20160803-0800I20160802-2000I20160802-0800I20160801-2000I20160801-0800I20160731-2000I20160726-1400I20160726-0800I20160719-0800I20160716-1900
derived
Change-Id: I7ff18cea64a58827ab74374c2b8db5fb97b80837
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rwxr-xr-x | bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java | 13 | ||||
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java index 983fabf9e..07f7f7ff8 100755 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java @@ -2417,6 +2417,19 @@ public class SystemBundleTests extends AbstractBundleTests { new Equinox(null); } + public void testNullStorageArea() throws BundleException { + File install = getContext().getDataFile(getName()); + install.mkdirs(); + Equinox equinox = new Equinox(Collections.singletonMap("osgi.install.area", install.getAbsolutePath())); + try { + equinox.init(); + String storageArea = equinox.getBundleContext().getProperty(Constants.FRAMEWORK_STORAGE); + assertNotNull("No storage area set.", storageArea); + } finally { + equinox.stop(); + } + } + public void testOSGiDevSetsCheckConfiguration() throws BundleException { String originalCheckConfiguration = System.clearProperty(EquinoxConfiguration.PROP_CHECK_CONFIGURATION); try { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java index eb554cddc..a58275014 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java @@ -126,6 +126,12 @@ public class Storage { Location parent = this.osgiLocation.getParentLocation(); parentRoot = parent == null ? null : new File(parent.getURL().getFile()); + if (container.getConfiguration().getConfiguration(Constants.FRAMEWORK_STORAGE) == null) { + // Set the derived value if not already set as part of configuration. + // Note this is the parent directory of where the framework stores data (org.eclipse.osgi/) + container.getConfiguration().setConfiguration(Constants.FRAMEWORK_STORAGE, childRoot.getParentFile().getAbsolutePath()); + } + InputStream info = getInfoInputStream(); DataInputStream data = info == null ? null : new DataInputStream(new BufferedInputStream(info)); try { |