Revert experimental logging for bug 381942: JavaLeakTest fails in 4.2 build
diff --git a/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/JavaLeakTest.java b/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/JavaLeakTest.java
index 0cae4e1..1ccf7d2 100644
--- a/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/JavaLeakTest.java
+++ b/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/JavaLeakTest.java
@@ -25,7 +25,6 @@
import org.eclipse.core.commands.common.EventManager;
import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -110,8 +109,6 @@
assertTrue("Could not close editor", JavaPlugin.getActivePage().closeEditor(editor1, false));
editor1= null;
- int searchBundleState= Platform.getBundle("org.eclipse.search").getState();
- System.out.println("JavaLeakTest.testTextEditorCloseOneOfTwo(): searchBundleState = 0x" + Integer.toHexString(searchBundleState));
assertInstanceCount(TextEditor.class, 0);
}
diff --git a/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/ScreenshotTest.java b/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/ScreenshotTest.java
deleted file mode 100644
index de3a707..0000000
--- a/org.eclipse.jdt.ui.tests/leaks/org/eclipse/jdt/ui/tests/leaks/ScreenshotTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.ui.tests.leaks;
-
-import java.io.File;
-import java.io.PrintStream;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Reduced copy of org.eclipse.ui.workbench.texteditor.tests.ScreenshotTest.
- */
-class ScreenshotTest extends TestCase {
-
- public ScreenshotTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return new TestSuite(ScreenshotTest.class);
- }
-
- /**
- * Takes a screenshot and dumps other debugging information to the given stream.
- *
- * @param testClass test class that takes the screenshot
- * @param name screenshot identifier (e.g. test name)
- * @param out print stream to use for diagnostics.
- * @return file system path to the screenshot file
- */
- public static String takeScreenshot(Class testClass, String name, PrintStream out) {
- File resultsHtmlDir= getJunitReportOutput(); // ends up in testresults/linux.gtk.x86_6.0/<class>.<test>.png
-
- if (resultsHtmlDir == null) { // Fallback. Warning: uses same file location on all test platforms:
- File eclipseDir= new File("").getAbsoluteFile(); // eclipse-testing/test-eclipse/eclipse
- resultsHtmlDir= new File(eclipseDir, "../../results/html/").getAbsoluteFile(); // ends up in testresults/html/<class>.<test>.png
- }
-
- Display display= PlatformUI.getWorkbench().getDisplay();
-
- // Dump focus control, parents, and shells:
- Control focusControl = display.getFocusControl();
- if (focusControl != null) {
- out.println("FocusControl: ");
- StringBuffer indent = new StringBuffer(" ");
- do {
- out.println(indent.toString() + focusControl);
- focusControl = focusControl.getParent();
- indent.append(" ");
- } while (focusControl != null);
- }
- Shell[] shells = display.getShells();
- if (shells.length > 0) {
- out.println("Shells: ");
- for (int i = 0; i < shells.length; i++) {
- Shell shell = shells[i];
- out.println((shell.isVisible() ? " visible: " : " invisible: ") + shell);
- }
- }
-
- // Take a screenshot:
- GC gc = new GC(display);
- final Image image = new Image(display, display.getBounds());
- gc.copyArea(image, 0, 0);
- gc.dispose();
-
- resultsHtmlDir.mkdirs();
- String filename = new File(
- resultsHtmlDir.getAbsolutePath(),
- testClass.getName() + "." + name + ".png").getAbsolutePath();
- ImageLoader loader = new ImageLoader();
- loader.data = new ImageData[] { image.getImageData() };
- loader.save(filename, SWT.IMAGE_PNG);
- out.println("Screenshot saved to: " + filename);
- image.dispose();
- return filename;
- }
-
- private static File getJunitReportOutput() {
- String[] args= Platform.getCommandLineArgs();
- for (int i= 0; i < args.length - 1; i++) {
- if ("-junitReportOutput".equals(args[i])) { // see library.xml and org.eclipse.test.EclipseTestRunner
- return new File(args[i + 1]).getAbsoluteFile();
- }
- }
- return null;
- }
-
- private static void runEventQueue() {
- Display display= PlatformUI.getWorkbench().getDisplay();
- for (int i= 0; i < 10; i++) { // workaround for https://bugs.eclipse.org/323272
- while (display.readAndDispatch()) {
- // do nothing
- }
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- }
-}