diff options
author | Rolf Theunissen | 2019-03-23 17:46:23 +0000 |
---|---|---|
committer | Rolf Theunissen | 2019-03-23 17:56:39 +0000 |
commit | e3bbb556534a1fb945e1036948325d14a8dd9c7a (patch) | |
tree | af8b70171bfdb66f78a7e0563556f409b5670945 | |
parent | c5b196aee37d6953a9fe01054f362004da6730b6 (diff) | |
download | eclipse.platform.ui-e3bbb556534a1fb945e1036948325d14a8dd9c7a.tar.gz eclipse.platform.ui-e3bbb556534a1fb945e1036948325d14a8dd9c7a.tar.xz eclipse.platform.ui-e3bbb556534a1fb945e1036948325d14a8dd9c7a.zip |
Bug 485167 - LeaksTestSuite should run with UiTestSuiteI20190325-0105I20190324-1800I20190323-1800
Change-Id: I935dc7e4d339d591cab00577f97e7acbc297e463
Signed-off-by: Rolf Theunissen <rolf.theunissen@gmail.com>
3 files changed, 51 insertions, 29 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java index 83ea1b5a34d..b712813f767 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java @@ -34,6 +34,7 @@ import org.eclipse.ui.tests.filteredtree.FilteredTreeTests; import org.eclipse.ui.tests.filteredtree.PatternFilterTest; import org.eclipse.ui.tests.internal.InternalTestSuite; import org.eclipse.ui.tests.keys.KeysTestSuite; +import org.eclipse.ui.tests.leaks.LeaksTestSuite; import org.eclipse.ui.tests.menus.MenusTestSuite; import org.eclipse.ui.tests.multipageeditor.MultiPageEditorTestSuite; import org.eclipse.ui.tests.navigator.NavigatorTestSuite; @@ -82,7 +83,8 @@ import org.junit.runners.Suite; QuickAccessTestSuite.class, FilteredResourcesSelectionDialogTestSuite.class, DirectoryProposalContentAssistTestSuite.class, - InternalTestSuite.class + InternalTestSuite.class, + LeaksTestSuite.class, }) public class UiTestSuite { @@ -92,7 +94,6 @@ public class UiTestSuite { // CommandsTestSuite.class, // DragTestSuite.class, // IntroTestSuite.class, - // LeakTests.class, // MultiEditorTestSuite.class, // OpenSystemInPlaceEditorTest..class, } diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java index f7f464b205a..993975f6f85 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeakTests.java @@ -277,33 +277,28 @@ public class LeakTests extends UITestCase { } } - /** - * No idea why the following test is failing. Doug has ran this through a - * profiler and for some reason the window just isn't being GCd despite - * there not being nay incoming references. - */ -// public void testSimpleWindowLeak() throws Exception { -// //turn off window management so that we dont have a reference to our -// // new -// //window in the listener -// manageWindows(false); -// try { -// ReferenceQueue queue = new ReferenceQueue(); -// IWorkbenchWindow newWindow = openTestWindow(); -// -// assertNotNull(newWindow); -// Reference ref = createReference(queue, newWindow); -// try { -// newWindow.close(); -// newWindow = null; -// checkRef(queue, ref); -// } finally { -// ref.clear(); -// } -// } finally { -// manageWindows(true); -// } -// } + public void testSimpleWindowLeak() throws Exception { + // turn off window management so that we dont have a reference to our + // new + // window in the listener + manageWindows(false); + try { + ReferenceQueue queue = new ReferenceQueue(); + IWorkbenchWindow newWindow = openTestWindow(); + + assertNotNull(newWindow); + Reference ref = createReference(queue, newWindow); + try { + newWindow.close(); + newWindow = null; + checkRef(queue, ref); + } finally { + ref.clear(); + } + } finally { + manageWindows(true); + } + } /** * Test for leaks if dialog is disposed before it is closed. diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeaksTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeaksTestSuite.java new file mode 100644 index 00000000000..1e7d9aa5e51 --- /dev/null +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/leaks/LeaksTestSuite.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2019 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.ui.tests.leaks; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ + LeakTests.class, + Bug397302Tests.class, +}) +public class LeaksTestSuite { +} |