From 245715bdda65fdeaf5844f83a2910c74e4f966b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Sat, 18 Jan 2025 11:45:05 +0200 Subject: [PATCH] Stop using deprecated APIs in o.e.ui.tests --- .../Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java | 6 +----- .../org/eclipse/ui/tests/dnd/DragTestSuite.java | 6 +++--- .../org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java index 74354d7d377..61d5ca6a292 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -164,10 +164,6 @@ public void doSetUp() throws Exception { file1 = FileUtil.createFile("DragTest1.txt", project); //$NON-NLS-1$ file2 = FileUtil.createFile("DragTest2.txt", project); //$NON-NLS-1$ file3 = FileUtil.createFile("DragTest3.txt", project); //$NON-NLS-1$ - - // Disable animations since they occur concurrently and can interferre - // with locating drop targets - setPreference(PrefUtil.getAPIPreferenceStore(), IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false); } page.resetPerspective(); diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTestSuite.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTestSuite.java index b9dbc8360a1..33da3d6bf82 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTestSuite.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dnd/DragTestSuite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2021 IBM Corporation and others. + * Copyright (c) 2004, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -13,8 +13,8 @@ *******************************************************************************/ package org.eclipse.ui.tests.dnd; +import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Platform; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; @@ -58,7 +58,7 @@ public static Test suite() { } public DragTestSuite() { - super(Platform.find(TestPlugin.getDefault().getBundle(), IPath.fromOSString("data/dragtests.xml"))); + super(FileLocator.find(TestPlugin.getDefault().getBundle(), IPath.fromOSString("data/dragtests.xml"))); String resNav = IPageLayout.ID_PROJECT_EXPLORER; String probView = IPageLayout.ID_PROBLEM_VIEW; diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java index 00d39cfb7b0..b79f4a74600 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -16,7 +16,7 @@ import java.io.IOException; import java.net.URL; -import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.FileLocator; import org.eclipse.ui.tests.TestPlugin; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; @@ -32,7 +32,7 @@ public static final Bundle installPlugin(String pluginName) "TestPlugin default reference is null"); } String pluginLocation = null; - URL dataURL = Platform.resolve(plugin.getBundle().getEntry(pluginName)); + URL dataURL = FileLocator.resolve(plugin.getBundle().getEntry(pluginName)); pluginLocation = "reference:" + dataURL.toExternalForm(); return TestInstallUtil.installBundle(pluginLocation); }