From 78615b83bfb39e49f20724c0dc78c1eab47c6c53 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: Tue, 10 Dec 2024 11:18:17 +0200 Subject: [PATCH] Stop requiring jdt.ui in o.e.ui.tests There are enough resources available to handle tests without loading JDT UI and putting extra requirements and circular dependencies between repositories. --- .../org/eclipse/ui/tests/api/EditorIconTest.java | 4 ++-- .../eclipse/ui/tests/stress/OpenCloseTest.java | 16 ++++++++-------- tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF | 2 +- tests/org.eclipse.ui.tests/plugin.xml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java index 8c68c6734c9..92a10bf67fa 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2024 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -67,7 +67,7 @@ public void testNonDependantBundleIcon() { .getDefaultEditor( "foo.icontest2").getImageDescriptor().createImage(); i2 = ResourceLocator.imageDescriptorFromBundle( - "org.eclipse.jdt.ui", "icons/full/obj16/class_obj.png") // layer breaker! + "org.eclipse.debug.ui", "icons/full/obj16/file_obj.png") // layer breaker! .orElseThrow(AssertionError::new).createImage(); ImageTests.assertEquals(i1, i2); } diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java index 40dd534b603..f9c7cd40acb 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java @@ -48,7 +48,7 @@ * Test opening and closing of items. */ public class OpenCloseTest { - private static final String ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE = "org.eclipse.jdt.ui.JavaPerspective"; + private static final String ORG_ECLIPSE_RESOURCE_PERSPECTIVE = "org.eclipse.ui.resourcePerspective"; private static final int numIterations = 10; @@ -67,7 +67,7 @@ public void setup() { } try { - PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE, workbenchWindow); + PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE, workbenchWindow); } catch (WorkbenchException e) { e.printStackTrace(); } @@ -101,7 +101,7 @@ public void testOpenCloseFile() throws CoreException { */ @Test public void testOpenCloseWorkbenchWindow() throws WorkbenchException { - IWorkbenchWindow secondWorkbenchWindow = null; + IWorkbenchWindow secondWorkbenchWindow; for (int index = 0; index < numIterations; index++) { secondWorkbenchWindow = PlatformUI.getWorkbench() .openWorkbenchWindow(ResourcesPlugin.getWorkspace().getRoot()); @@ -119,7 +119,7 @@ public void testOpenClosePerspective() { HashMap parameters = new HashMap<>(); parameters.put(IWorkbenchCommandConstants.WINDOW_CLOSE_PERSPECTIVE_PARM_ID, - ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE); + ORG_ECLIPSE_RESOURCE_PERSPECTIVE); ParameterizedCommand pCommand = ParameterizedCommand.generateCommand(command, parameters); @@ -127,7 +127,7 @@ public void testOpenClosePerspective() { for (int index = 0; index < numIterations; index++) { try { - PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE, workbenchWindow); + PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE, workbenchWindow); try { handlerService.executeCommand(pCommand, null); } catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e1) { @@ -143,8 +143,8 @@ public void testOpenClosePerspective() { */ @Test public void testOpenCloseView() throws WorkbenchException { - IViewPart consoleView = null; - IWorkbenchPage page = PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE, + IViewPart consoleView; + IWorkbenchPage page = PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE, workbenchWindow); for (int index = 0; index < numIterations; index++) { consoleView = page.showView(IPageLayout.ID_MINIMAP_VIEW); @@ -157,7 +157,7 @@ public void testOpenCloseView() throws WorkbenchException { */ @Test public void testOpenCloseIntro() { - IIntroPart introPart = null; + IIntroPart introPart; for (int index = 0; index < numIterations; index++) { introPart = PlatformUI.getWorkbench().getIntroManager().showIntro(workbenchWindow, false); PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart); diff --git a/tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF index 4832c6b1d13..ab9288a267d 100644 --- a/tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF @@ -40,9 +40,9 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="3.14.0", org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.0", org.mockito.mockito-core;bundle-version="2.13.0", org.eclipse.ui.views.log;bundle-version="1.2.1300", - org.eclipse.jdt.ui, org.eclipse.ui.navigator;bundle-version="3.12.100", org.eclipse.search, + org.eclipse.debug.ui, org.eclipse.emf.ecore Import-Package: jakarta.annotation, jakarta.inject, diff --git a/tests/org.eclipse.ui.tests/plugin.xml b/tests/org.eclipse.ui.tests/plugin.xml index 6350e67b8c6..2e16cdb6ef3 100644 --- a/tests/org.eclipse.ui.tests/plugin.xml +++ b/tests/org.eclipse.ui.tests/plugin.xml @@ -723,7 +723,7 @@ extensions="icontest1"/>