diff options
author | Thomas Watson | 2011-07-25 15:57:43 +0000 |
---|---|---|
committer | Thomas Watson | 2011-07-25 15:57:43 +0000 |
commit | cee3c90c53b423ac28aa1ec3175596eb3e9fec7d (patch) | |
tree | 8b4ef6a4cbe7ba48486016ef45fa73d42fed88c4 /bundles/org.eclipse.osgi.tests | |
parent | c525aa2a29d0d7db2d8b13d72fdd595977670311 (diff) | |
download | rt.equinox.framework-cee3c90c53b423ac28aa1ec3175596eb3e9fec7d.tar.gz rt.equinox.framework-cee3c90c53b423ac28aa1ec3175596eb3e9fec7d.tar.xz rt.equinox.framework-cee3c90c53b423ac28aa1ec3175596eb3e9fec7d.zip |
Remove the recursive log listener at the end of test.
Diffstat (limited to 'bundles/org.eclipse.osgi.tests')
-rw-r--r-- | bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java index c9e680241..bcf6b681e 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java @@ -434,18 +434,22 @@ public class LoggingTests extends AbstractBundleTests { final Bundle testBundle = installer.installBundle("test.logging.a"); //$NON-NLS-1$ testBundle.start(); LogServiceReference logRef = getLogService(getContext()); - Platform.addLogListener(new ILogListener() { + ILogListener recurseLog = new ILogListener() { public void logging(IStatus status, String plugin) { Platform.getLog(testBundle).log(status); } - }); - logRef.fwkLog.log(new FrameworkLogEntry(getContext().getBundle().getSymbolicName(), FrameworkLogEntry.ERROR, 0, "Test message", 0, null, null)); - - // prime the log so we don't have to create it in the logging call - Platform.getLog(testBundle); + }; + Platform.addLogListener(recurseLog); + try { + logRef.fwkLog.log(new FrameworkLogEntry(getContext().getBundle().getSymbolicName(), FrameworkLogEntry.ERROR, 0, "Test message", 0, null, null)); - logRef.fwkLog.log(new FrameworkLogEntry(getContext().getBundle().getSymbolicName(), FrameworkLogEntry.ERROR, 0, "Test message", 0, null, null)); + // prime the log so we don't have to create it in the logging call + Platform.getLog(testBundle); + logRef.fwkLog.log(new FrameworkLogEntry(getContext().getBundle().getSymbolicName(), FrameworkLogEntry.ERROR, 0, "Test message", 0, null, null)); + } finally { + Platform.removeLogListener(recurseLog); + } } } |