Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-08-03 21:34:00 +0000
committerThomas Watson2011-08-03 21:34:00 +0000
commit098ec2fe0757231dee3d7ff919cf6e66e00df026 (patch)
treec3d329dddc15a6d37128bbc635ce6777a41bed05
parente69aca2a55acfadc37b68aed0e637329a3379315 (diff)
downloadrt.equinox.framework-098ec2fe0757231dee3d7ff919cf6e66e00df026.tar.gz
rt.equinox.framework-098ec2fe0757231dee3d7ff919cf6e66e00df026.tar.xz
rt.equinox.framework-098ec2fe0757231dee3d7ff919cf6e66e00df026.zip
Remove the recursive log listener at the end of test.R37x_v20110803-1643
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/LoggingTests.java18
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);
+ }
}
}

Back to the top