diff options
| author | Paul Pazderski | 2019-02-26 21:50:07 +0000 |
|---|---|---|
| committer | Sarika Sinha | 2019-04-03 12:32:07 +0000 |
| commit | fefdf3218e30d555278df1fb51918ebf43377eef (patch) | |
| tree | 4417d5afc45c6f45df42476ebb190f33ea4e4674 | |
| parent | f7d625c87bae193efae32371c02e02d8d806b6bb (diff) | |
| download | eclipse.jdt.debug-fefdf3218e30d555278df1fb51918ebf43377eef.tar.gz eclipse.jdt.debug-fefdf3218e30d555278df1fb51918ebf43377eef.tar.xz eclipse.jdt.debug-fefdf3218e30d555278df1fb51918ebf43377eef.zip | |
Bug 545327 - [tests] Fix launch configuration leak in performance testsI20190403-1800
Change-Id: Ibf942b60280969bab0e8d807ef83bfe0c9bf2981
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
| -rw-r--r-- | org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java index c4a1a30c3..9e32b9734 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/PerfConsoleTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -13,12 +13,12 @@ *******************************************************************************/ package org.eclipse.jdt.debug.tests.performance; +import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; -import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.console.IConsole; import org.eclipse.debug.ui.console.IConsoleLineTrackerExtension; import org.eclipse.jdt.debug.testplugin.ConsoleLineTracker; @@ -191,20 +191,18 @@ public class PerfConsoleTests extends AbstractDebugPerformanceTest implements IC * @throws Exception */ protected void launchWorkingCopyAndWait(final ILaunchConfigurationWorkingCopy workingCopy) throws Exception { - Runnable runnable = new Runnable() { - @Override - public void run() { - DebugUITools.launch(workingCopy, ILaunchManager.RUN_MODE); - } - }; - - DebugUIPlugin.getStandardDisplay().asyncExec(runnable); - - synchronized (fLock) { - if (!fStopped) { - fLock.wait(360000); - } - } + ILaunch launch = null; + try { + launch = workingCopy.launch(ILaunchManager.RUN_MODE, null); + synchronized (fLock) { + if (!fStopped) { + fLock.wait(360000); + } + } + } finally { + assertTrue("Test program took to long.", launch.isTerminated()); + getLaunchManager().removeLaunch(launch); + } } /** |
