Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-05-25 07:33:02 -0400
committerAndrey Loskutov2017-07-03 10:22:15 -0400
commit1cd6adec4e47244e9d6766e30ba74e5a6e9248c3 (patch)
tree6dca1323e1320e5fb2638a633341e4c63668d820
parent1fd32c429d8d898eb138815015be17183d847496 (diff)
downloadeclipse.platform.debug-1cd6adec4e47244e9d6766e30ba74e5a6e9248c3.tar.gz
eclipse.platform.debug-1cd6adec4e47244e9d6766e30ba74e5a6e9248c3.tar.xz
eclipse.platform.debug-1cd6adec4e47244e9d6766e30ba74e5a6e9248c3.zip
Bug 439017 - let all debug test extend AbstractDebugTest
Added AbstractDebugTest and TestUtil, and let all debug tests extend AbstractDebugTest and properly report setup/teardown sequence. Change-Id: Id7e866a78c9653754d6bd8ba27dac02238c2fa0d Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/AbstractDebugTest.java95
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java206
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleManagerTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java2
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/stepfilters/StepFiltersTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java8
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java13
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java5
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java7
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java7
30 files changed, 383 insertions, 93 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AbstractDebugTest.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AbstractDebugTest.java
new file mode 100644
index 000000000..39e3134d3
--- /dev/null
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AbstractDebugTest.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Andrey Loskutov and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrey Loskutov <loskutov@gmx.de> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.tests;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.intro.IIntroManager;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.progress.UIJob;
+
+import junit.framework.TestCase;
+
+public class AbstractDebugTest extends TestCase {
+
+ private static boolean welcomeClosed;
+
+ public AbstractDebugTest() {
+ super();
+ }
+
+ public AbstractDebugTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ TestUtil.log(IStatus.INFO, getName(), "setUp");
+ assertWelcomeScreenClosed();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ TestUtil.log(IStatus.INFO, getName(), "tearDown");
+ TestUtil.cleanUp(getName());
+ super.tearDown();
+ }
+
+ /**
+ * Ensure the welcome screen is closed because in 4.x the debug perspective
+ * opens a giant fast-view causing issues
+ *
+ * @throws Exception
+ */
+ protected final void assertWelcomeScreenClosed() throws Exception {
+ if (!welcomeClosed && PlatformUI.isWorkbenchRunning()) {
+ final IWorkbench wb = PlatformUI.getWorkbench();
+ if (wb == null) {
+ return;
+ }
+ // In UI thread we don't need to run a job
+ if (Display.getCurrent() != null) {
+ closeIntro(wb);
+ return;
+ }
+
+ UIJob job = new UIJob("close welcome screen for debug test suite") {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ closeIntro(wb);
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.setPriority(Job.INTERACTIVE);
+ job.setSystem(true);
+ job.schedule();
+ }
+ }
+
+ private static void closeIntro(final IWorkbench wb) {
+ IWorkbenchWindow window = wb.getActiveWorkbenchWindow();
+ if (window != null) {
+ IIntroManager im = wb.getIntroManager();
+ IIntroPart intro = im.getIntro();
+ if (intro != null) {
+ welcomeClosed = im.closeIntro(intro);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java
new file mode 100644
index 000000000..1453b64dd
--- /dev/null
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestUtil.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Google, Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Stefan Xenos (Google) - Initial implementation
+ * Andrey Loskutov (loskutov@gmx.de) - many different extensions
+ *******************************************************************************/
+package org.eclipse.debug.tests;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadInfo;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.junit.Assert;
+
+public class TestUtil {
+
+ /**
+ * Call this in the tearDown method of every test to clean up state that can
+ * otherwise leak through SWT between tests.
+ */
+ public static void cleanUp(String owner) {
+ // Ensure that the Thread.interrupted() flag didn't leak.
+ Assert.assertFalse("The main thread should not be interrupted at the end of a test", Thread.interrupted());
+
+ // Wait for any outstanding jobs to finish. Protect against deadlock by
+ // terminating the wait after a timeout.
+ boolean timedOut = waitForJobs(owner, 5, 5000);
+ if (timedOut) {
+ // We don't expect any extra jobs run during the test: try to cancel them
+ log(IStatus.INFO, owner, "Trying to cancel running jobs: " + getRunningOrWaitingJobs(null));
+ getRunningOrWaitingJobs(null).forEach(job -> job.cancel());
+ waitForJobs(owner, 5, 1000);
+ }
+
+ // Ensure that the Thread.interrupted() flag didn't leak.
+ Assert.assertFalse("The main thread should not be interrupted at the end of a test", Thread.interrupted());
+ }
+
+ public static void log(int severity, String owner, String message, Throwable... optionalError) {
+ message = "[" + owner + "] " + message;
+ Throwable error = null;
+ if (optionalError != null && optionalError.length > 0) {
+ error = optionalError[0];
+ }
+ Status status = new Status(severity, TestsPlugin.getDefault().getBundle().getSymbolicName(), message, error);
+ TestsPlugin.getDefault().getLog().log(status);
+ }
+
+ /**
+ * Process all queued UI events. If called from background thread, does
+ * nothing.
+ */
+ public static void runEventLoop() {
+ Display display = Display.getCurrent();
+ if (display != null && !display.isDisposed()) {
+ while (display.readAndDispatch()) {
+ // Keep pumping events until the queue is empty
+ }
+ }
+ }
+
+ /**
+ * Utility for waiting until the execution of jobs of any family has finished or timeout is reached. If no jobs are running, the method waits
+ * given minimum wait time. While this method is waiting for jobs, UI events are processed.
+ *
+ * @param owner
+ * name of the caller which will be logged as prefix if the wait times out
+ * @param minTimeMs
+ * minimum wait time in milliseconds
+ * @param maxTimeMs
+ * maximum wait time in milliseconds
+ * @return true if the method timed out, false if all the jobs terminated before the timeout
+ */
+ public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs) {
+ return waitForJobs(owner, minTimeMs, maxTimeMs, (Object[]) null);
+ }
+
+ /**
+ * Utility for waiting until the execution of jobs of any family has finished or timeout is reached. If no jobs are running, the method waits
+ * given minimum wait time. While this method is waiting for jobs, UI events are processed.
+ *
+ * @param owner
+ * name of the caller which will be logged as prefix if the wait times out
+ * @param minTimeMs
+ * minimum wait time in milliseconds
+ * @param maxTimeMs
+ * maximum wait time in milliseconds
+ * @param excludedFamilies
+ * optional list of job families to NOT wait for
+ *
+ * @return true if the method timed out, false if all the jobs terminated before the timeout
+ */
+ public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs, Object... excludedFamilies) {
+ if (maxTimeMs < minTimeMs) {
+ throw new IllegalArgumentException("Max time is smaller as min time!");
+ }
+ final long start = System.currentTimeMillis();
+ while (System.currentTimeMillis() - start < minTimeMs) {
+ runEventLoop();
+ try {
+ Thread.sleep(Math.min(10, minTimeMs));
+ } catch (InterruptedException e) {
+ // Uninterruptable
+ }
+ }
+ while (!Job.getJobManager().isIdle()) {
+ List<Job> jobs = getRunningOrWaitingJobs(null, excludedFamilies);
+ if (jobs.isEmpty()) {
+ // only uninteresting jobs running
+ break;
+ }
+
+ if (!Collections.disjoint(runningJobs, jobs)) {
+ // There is a job which runs already quite some time, don't wait for it to avoid test timeouts
+ dumpRunningOrWaitingJobs(owner, jobs);
+ return true;
+ }
+
+ if (System.currentTimeMillis() - start >= maxTimeMs) {
+ dumpRunningOrWaitingJobs(owner, jobs);
+ return true;
+ }
+ runEventLoop();
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ // Uninterruptable
+ }
+ }
+ runningJobs.clear();
+ return false;
+ }
+
+ static Set<Job> runningJobs = new LinkedHashSet<>();
+
+ private static void dumpRunningOrWaitingJobs(String owner, List<Job> jobs) {
+ String message = "Some job is still running or waiting to run: " + dumpRunningOrWaitingJobs(jobs);
+ log(IStatus.ERROR, owner, message);
+ }
+
+ private static String dumpRunningOrWaitingJobs(List<Job> jobs) {
+ if (jobs.isEmpty()) {
+ return "";
+ }
+ // clear "old" running jobs, we only remember most recent
+ runningJobs.clear();
+ StringBuilder sb = new StringBuilder();
+ for (Job job : jobs) {
+ runningJobs.add(job);
+ sb.append("\n'").append(job.toString()).append("'/");
+ sb.append(job.getClass().getName());
+ Thread thread = job.getThread();
+ if (thread != null) {
+ ThreadInfo[] threadInfos = ManagementFactory.getThreadMXBean().getThreadInfo(new long[] { thread.getId() }, true, true);
+ if (threadInfos[0] != null) {
+ sb.append("\nthread info: ").append(threadInfos[0]);
+ }
+ }
+ sb.append(", ");
+ }
+ sb.setLength(sb.length() - 2);
+ return sb.toString();
+ }
+
+ public static List<Job> getRunningOrWaitingJobs(Object jobFamily, Object... excludedFamilies) {
+ List<Job> running = new ArrayList<>();
+ Job[] jobs = Job.getJobManager().find(jobFamily);
+ for (Job job : jobs) {
+ if (isRunningOrWaitingJob(job) && !belongsToFamilies(job, excludedFamilies)) {
+ running.add(job);
+ }
+ }
+ return running;
+ }
+
+ private static boolean isRunningOrWaitingJob(Job job) {
+ int state = job.getState();
+ return (state == Job.RUNNING || state == Job.WAITING);
+ }
+
+ private static boolean belongsToFamilies(Job job, Object... excludedFamilies) {
+ if (excludedFamilies == null || excludedFamilies.length == 0) {
+ return false;
+ }
+ for (Object family : excludedFamilies) {
+ if (job.belongsTo(family)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
index 94b162520..66b924b3f 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
@@ -12,8 +12,6 @@ package org.eclipse.debug.tests.breakpoint;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
@@ -26,6 +24,7 @@ import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.ILineBreakpoint;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsComparator;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.TestsPlugin;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IValueDetailListener;
@@ -42,7 +41,7 @@ import org.eclipse.ui.IEditorInput;
*
* Using a special Comparator which sorts breakpoint texts like file:1, file:2 and file:11 in a numerical ordering.
*/
-public class BreakpointOrderingTests extends TestCase {
+public class BreakpointOrderingTests extends AbstractDebugTest {
public BreakpointOrderingTests(String name) {
super(name);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleManagerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleManagerTests.java
index fb0a025ec..277ad9797 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleManagerTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleManagerTests.java
@@ -16,6 +16,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.swt.SWT;
@@ -34,12 +35,10 @@ import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.MessagePage;
-import junit.framework.TestCase;
-
/**
* Tests console manager
*/
-public class ConsoleManagerTests extends TestCase {
+public class ConsoleManagerTests extends AbstractDebugTest {
private static final String INTROVIEW_ID = "org.eclipse.ui.internal.introview"; //$NON-NLS-1$
private ExecutorService executorService;
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
index fb05f3ef5..f59f0c75d 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
@@ -14,6 +14,7 @@ package org.eclipse.debug.tests.console;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IOConsoleOutputStream;
@@ -22,7 +23,7 @@ import org.eclipse.ui.console.MessageConsole;
import junit.framework.TestCase;
-public class ConsoleTests extends TestCase {
+public class ConsoleTests extends AbstractDebugTest {
public ConsoleTests() {
super("ConsoleTests"); //$NON-NLS-1$
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
index 962c0bd68..626466eb6 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
@@ -13,8 +13,6 @@ package org.eclipse.debug.tests.expressions;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IExpressionListener;
import org.eclipse.debug.core.IExpressionManager;
@@ -23,11 +21,12 @@ import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.core.model.IWatchExpression;
import org.eclipse.debug.internal.core.ExpressionManager;
import org.eclipse.debug.internal.core.IExpressionsListener2;
+import org.eclipse.debug.tests.AbstractDebugTest;
/**
* Tests expression manager and listener call backs
*/
-public class ExpressionManagerTests extends TestCase {
+public class ExpressionManagerTests extends AbstractDebugTest {
class SinlgeListener implements IExpressionListener {
@@ -154,14 +153,11 @@ public class ExpressionManagerTests extends TestCase {
return DebugPlugin.getDefault().getExpressionManager();
}
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
@Override
protected void tearDown() throws Exception {
// remove all expressions from the manager
- super.tearDown();
getManager().removeExpressions(getManager().getExpressions());
+ super.tearDown();
}
/**
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
index 6de7f9768..74f3cc141 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AbstractLaunchTest.java
@@ -18,13 +18,12 @@ 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.launchConfigurations.LaunchConfigurationManager;
-
-import junit.framework.TestCase;
+import org.eclipse.debug.tests.AbstractDebugTest;
/**
* Common function for launch related tests.
*/
-public abstract class AbstractLaunchTest extends TestCase {
+public abstract class AbstractLaunchTest extends AbstractDebugTest {
/**
* Constructs a test with the given name.
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java
index edb3091a9..379e836b7 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/AcceleratorSubstitutionTests.java
@@ -10,9 +10,8 @@
*******************************************************************************/
package org.eclipse.debug.tests.launching;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.tests.AbstractDebugTest;
/**
* Tests accelerator adjustments for DBCS languages.
@@ -20,7 +19,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
*
* @since 3.3
*/
-public class AcceleratorSubstitutionTests extends TestCase {
+public class AcceleratorSubstitutionTests extends AbstractDebugTest {
/**
* Constructor
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
index d5e85e50e..a662ef3a7 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/ArgumentParsingTests.java
@@ -25,15 +25,14 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.osgi.service.environment.Constants;
-import junit.framework.TestCase;
-
/**
* Tests {@link org.eclipse.debug.core.DebugPlugin#parseArguments(String)} and
* {@link org.eclipse.debug.core.DebugPlugin#renderArguments(String[], int[])}.
*/
-public class ArgumentParsingTests extends TestCase {
+public class ArgumentParsingTests extends AbstractDebugTest {
private void execute1Arg(String cmdLine) throws Exception {
execute1Arg(cmdLine, cmdLine);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
index 688710202..6ddbf214e 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchFavoriteTests.java
@@ -74,12 +74,12 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
*/
@Override
protected void tearDown() throws Exception {
- super.tearDown();
// delete the configuration used during this test
ILaunchConfiguration configuration = getLaunchConfiguration();
if (configuration.exists()) {
configuration.delete();
}
+ super.tearDown();
}
/**
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java
index f644e1bd8..48e9a4c4f 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/sourcelookup/SourceLookupFacilityTests.java
@@ -17,16 +17,15 @@ import java.util.LinkedHashMap;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupResult;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import junit.framework.TestCase;
-
/**
* Tests {@link SourceLookupFacility}
*
* @since 3.9.200
*/
-public class SourceLookupFacilityTests extends TestCase {
+public class SourceLookupFacilityTests extends AbstractDebugTest {
/**
* {@link IStackFrame} to be reused
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java
index c425ac0c0..0b3d339f0 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.tests.statushandlers;
-import junit.framework.TestCase;
-
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -19,12 +17,13 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.core.Preferences;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.TestsPlugin;
/**
* Tests status handlers
*/
-public class StatusHandlerTests extends TestCase {
+public class StatusHandlerTests extends AbstractDebugTest {
/**
* Status for which a handler is registered.
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/stepfilters/StepFiltersTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/stepfilters/StepFiltersTests.java
index d93ec822a..b5ef0bd49 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/stepfilters/StepFiltersTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/stepfilters/StepFiltersTests.java
@@ -7,15 +7,14 @@
*******************************************************************************/
package org.eclipse.debug.tests.stepfilters;
-import junit.framework.TestCase;
-
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IStepFilter;
+import org.eclipse.debug.tests.AbstractDebugTest;
/**
* Tests step filters
*/
-public class StepFiltersTests extends TestCase {
+public class StepFiltersTests extends AbstractDebugTest {
public void testStepFitlersExtension_01() {
IStepFilter[] stepFilters = DebugPlugin.getStepFilters("com.example.lalala.model"); //$NON-NLS-1$
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java
index 9db3804da..f7fc4e354 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java
@@ -10,9 +10,8 @@
*******************************************************************************/
package org.eclipse.debug.tests.view.memory;
-import junit.framework.TestCase;
-
import org.eclipse.debug.core.model.IMemoryBlock;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
@@ -21,7 +20,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType;
/**
* Tests memory rendering manager
*/
-public class MemoryRenderingTests extends TestCase {
+public class MemoryRenderingTests extends AbstractDebugTest {
public MemoryRenderingTests(String name) {
super(name);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
index a4a3df63e..c4e66873a 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java
@@ -11,12 +11,11 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.layout.FillLayout;
@@ -32,7 +31,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-abstract public class CheckTests extends TestCase {
+abstract public class CheckTests extends AbstractDebugTest {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -47,6 +46,7 @@ abstract public class CheckTests extends TestCase {
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -76,6 +76,7 @@ abstract public class CheckTests extends TestCase {
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java
index 300cbe8bf..3608d6bd8 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.viewers.model.ChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
@@ -23,6 +21,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationCont
import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -38,13 +37,10 @@ import org.eclipse.swt.widgets.Display;
*
* @since 3.3
*/
-public class ChildrenUpdateTests extends TestCase {
+public class ChildrenUpdateTests extends AbstractDebugTest {
class BogusModelContentProvider extends TreeModelContentProvider {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#getViewer()
- */
@Override
protected IInternalTreeModelViewer getViewer() {
return new IInternalTreeModelViewer(){
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java
index 9fed7b530..672fa36f5 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java
@@ -13,14 +13,13 @@ package org.eclipse.debug.tests.viewer.model;
import java.util.Arrays;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation2;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.TreePath;
@@ -38,7 +37,7 @@ import org.eclipse.ui.XMLMemento;
/**
* Tests to verify that the viewer properly handles initial columns width.
*/
-public class ColumnPresentationTests extends TestCase implements ITestModelUpdatesListenerConstants {
+public class ColumnPresentationTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
private Display fDisplay;
private Shell fShell;
private TreeModelViewer fViewer;
@@ -49,20 +48,16 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
super(name);
}
- /**
- * @throws java.lang.Exception
- */
@Override
protected void setUp() throws Exception {
+ super.setUp();
createViewer();
}
- /**
- * @throws java.lang.Exception
- */
@Override
protected void tearDown() throws Exception {
destroyViewer();
+ super.tearDown();
}
void createViewer() {
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
index 7275130a1..016df79fe 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
@@ -15,8 +15,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate;
@@ -26,6 +24,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.layout.FillLayout;
@@ -39,7 +38,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-abstract public class ContentTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class ContentTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
@@ -55,6 +54,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -84,6 +84,7 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java
index 97a577af1..43b150bf2 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java
@@ -14,13 +14,12 @@ package org.eclipse.debug.tests.viewer.model;
import java.util.Arrays;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
@@ -34,7 +33,7 @@ import org.eclipse.ui.PlatformUI;
* Tests to verify that the viewer property retrieves and processes the
* model deltas generated by the test model.
*/
-abstract public class DeltaTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class DeltaTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -49,6 +48,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -79,6 +79,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java
index 4659ec17a..bd4a39efe 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java
@@ -13,14 +13,13 @@ package org.eclipse.debug.tests.viewer.model;
import java.util.regex.Pattern;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewerFilter;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
@@ -38,7 +37,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.8
*/
-abstract public class FilterTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class FilterTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
@@ -54,6 +53,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -83,6 +83,7 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java
index dc52f8b2f..a70173c62 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTransformTests.java
@@ -10,16 +10,15 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.viewers.model.FilterTransform;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.jface.viewers.TreePath;
/**
* Tests the virtual viewer's filter transform
* @since 3.3
*/
-public class FilterTransformTests extends TestCase {
+public class FilterTransformTests extends AbstractDebugTest {
public Object root;
public Object element0;
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
index cc557cb60..1f14448eb 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
@@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
@@ -23,6 +21,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisito
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.SWT;
@@ -34,7 +33,7 @@ import org.eclipse.ui.PlatformUI;
/**
* @since 3.6
*/
-public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpdatesListenerConstants {
+public class JFaceViewerTopIndexTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
@@ -50,6 +49,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setSize(300, 80);
@@ -77,6 +77,7 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java
index a19ae733a..97c7c7e23 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java
@@ -11,12 +11,11 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
@@ -32,7 +31,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-abstract public class LazyTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class LazyTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
@@ -48,6 +47,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -76,6 +76,7 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java
index 6193f56ae..d38581ffd 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java
@@ -11,13 +11,12 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -33,7 +32,7 @@ import org.eclipse.ui.PlatformUI;
/**
* Tests to measure the performance of the viewer updates.
*/
-abstract public class PerformanceTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class PerformanceTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -48,6 +47,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -78,6 +78,7 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
index 973a5a883..08503024e 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java
@@ -16,12 +16,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
@@ -39,7 +38,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-abstract public class PopupTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class PopupTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -54,6 +53,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -88,6 +88,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
+ super.tearDown();
}
/**
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java
index d89a54f03..6c47190ba 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java
@@ -11,10 +11,9 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.XMLMemento;
@@ -23,7 +22,7 @@ import org.eclipse.ui.XMLMemento;
*
* @since 3.4
*/
-public class PresentationContextTests extends TestCase {
+public class PresentationContextTests extends AbstractDebugTest {
public PresentationContextTests(String name) {
super(name);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
index f41b285c9..8cdc499c6 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java
@@ -14,13 +14,12 @@ package org.eclipse.debug.tests.viewer.model;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -34,7 +33,7 @@ import org.eclipse.ui.PlatformUI;
/**
* Tests to verify that the viewer properly handles selection changes.
*/
-abstract public class SelectionTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class SelectionTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -49,6 +48,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -78,6 +78,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
Thread.sleep(0);
}
}
+ super.tearDown();
}
private static class SelectionListener implements ISelectionChangedListener {
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
index 0e60a1d25..19a7dff88 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java
@@ -15,13 +15,12 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
@@ -37,7 +36,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-abstract public class StateTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class StateTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -52,6 +51,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
@@ -82,6 +82,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
index 5aa42493b..48e3c71f4 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java
@@ -16,8 +16,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
@@ -26,6 +24,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisito
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.layout.FillLayout;
@@ -40,7 +39,7 @@ import org.junit.Assert;
*
* @since 3.6
*/
-abstract public class UpdateTests extends TestCase implements ITestModelUpdatesListenerConstants {
+abstract public class UpdateTests extends AbstractDebugTest implements ITestModelUpdatesListenerConstants {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -55,6 +54,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -84,6 +84,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
+ super.tearDown();
}
@Override
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
index a695acf5d..ac85112e6 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java
@@ -11,11 +11,10 @@
*******************************************************************************/
package org.eclipse.debug.tests.viewer.model;
-import junit.framework.TestCase;
-
import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
+import org.eclipse.debug.tests.AbstractDebugTest;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
@@ -29,7 +28,7 @@ import org.eclipse.ui.PlatformUI;
*
* @since 3.6
*/
-public class VirtualViewerLazyModeTests extends TestCase {
+public class VirtualViewerLazyModeTests extends AbstractDebugTest {
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
@@ -44,6 +43,7 @@ public class VirtualViewerLazyModeTests extends TestCase {
*/
@Override
protected void setUp() throws Exception {
+ super.setUp();
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/);
fShell.setMaximized(true);
@@ -80,6 +80,7 @@ public class VirtualViewerLazyModeTests extends TestCase {
Thread.sleep(0);
}
}
+ super.tearDown();
}
public void test() {

Back to the top