Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2017-08-31 15:16:46 +0000
committerThomas Watson2017-08-31 15:16:46 +0000
commit3407146295bdd0c60d8595f9121ba6f44e5991a0 (patch)
tree873914456905bfb00c58ec17b482f8356c8cddd5 /bundles/org.eclipse.osgi.tests/src
parent18b75ba105ec2e868cb0c13dff1662e73813b678 (diff)
downloadrt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.tar.gz
rt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.tar.xz
rt.equinox.framework-3407146295bdd0c60d8595f9121ba6f44e5991a0.zip
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-xbundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/SystemBundleTests.java34
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);
+ }
+ }
+ }
}

Back to the top