diff options
author | Thomas Watson | 2017-08-31 15:16:46 +0000 |
---|---|---|
committer | Thomas Watson | 2017-08-31 15:16:46 +0000 |
commit | 3407146295bdd0c60d8595f9121ba6f44e5991a0 (patch) | |
tree | 873914456905bfb00c58ec17b482f8356c8cddd5 /bundles/org.eclipse.osgi.tests/src | |
parent | 18b75ba105ec2e868cb0c13dff1662e73813b678 (diff) | |
download | rt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.tar.gz rt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.tar.xz rt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.zip |
Bug 521542 - org.osgi.framework.storage is used even whenI20170911-0405I20170910-2000I20170910-1055I20170910-0800I20170909-1500I20170909-0920I20170909-0800I20170909-0510I20170908-2345I20170908-2000I20170908-0035I20170907-2000I20170906-2000I20170906-0815I20170906-0225I20170905-2000I20170905-0600I20170905-0310I20170904-2000I20170904-0230I20170903-2000I20170902-1500I20170901-2000I20170831-2000
osgi.configuration.area is set
Log a warning when this occurs.
Had to add an exceptions map that can be used during bootstrap
when there is no log service to log to yet. This allowed for
fixing several TODOs where we thought we should be logging but
couldn't because no log service was available yet.
Diffstat (limited to 'bundles/org.eclipse.osgi.tests/src')
-rwxr-xr-x | bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java | 34 |
1 files changed, 34 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 5129c9f41..3eb8f25d8 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 @@ -39,6 +39,7 @@ import org.osgi.framework.namespace.NativeNamespace; import org.osgi.framework.wiring.*; import org.osgi.resource.Capability; import org.osgi.resource.Requirement; +import org.osgi.service.log.*; import org.osgi.service.packageadmin.ExportedPackage; import org.osgi.service.packageadmin.PackageAdmin; import org.osgi.service.startlevel.StartLevel; @@ -3094,4 +3095,37 @@ public class SystemBundleTests extends AbstractBundleTests { } } } + + public void testOverrideEquinoxConfigAreaProp() { + File config = OSGiTestsActivator.getContext().getDataFile(getName()); //$NON-NLS-1$ + Map configuration = new HashMap(); + configuration.put(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath()); + configuration.put(EquinoxLocations.PROP_CONFIG_AREA, config.getAbsolutePath() + "-override"); + configuration.put(EquinoxConfiguration.PROP_LOG_HISTORY_MAX, "10"); + Equinox equinox = null; + try { + equinox = new Equinox(configuration); + equinox.init(); + BundleContext bc = equinox.getBundleContext(); + LogReaderService logReader = bc.getService(bc.getServiceReference(LogReaderService.class)); + Enumeration<LogEntry> logs = logReader.getLog(); + assertTrue("No logs found.", logs.hasMoreElements()); + LogEntry entry = logs.nextElement(); + assertEquals("Wrong log level.", LogLevel.WARN, entry.getLogLevel()); + assertTrue("Wrong message found: " + entry.getMessage(), entry.getMessage().contains(EquinoxLocations.PROP_CONFIG_AREA)); + } catch (BundleException e) { + fail("Failed init", e); + } finally { + try { + if (equinox != null) { + equinox.stop(); + equinox.waitForStop(1000); + } + } catch (BundleException e) { + fail("Failed to stop framework.", e); + } catch (InterruptedException e) { + fail("Failed to stop framework.", e); + } + } + } } |