Skip to content

Commit 78615b8

Browse files
committed
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.
1 parent b379121 commit 78615b8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/EditorIconTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2004, 2006 IBM Corporation and others.
2+
* Copyright (c) 2004, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -67,7 +67,7 @@ public void testNonDependantBundleIcon() {
6767
.getDefaultEditor(
6868
"foo.icontest2").getImageDescriptor().createImage();
6969
i2 = ResourceLocator.imageDescriptorFromBundle(
70-
"org.eclipse.jdt.ui", "icons/full/obj16/class_obj.png") // layer breaker!
70+
"org.eclipse.debug.ui", "icons/full/obj16/file_obj.png") // layer breaker!
7171
.orElseThrow(AssertionError::new).createImage();
7272
ImageTests.assertEquals(i1, i2);
7373
}

tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/stress/OpenCloseTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* Test opening and closing of items.
4949
*/
5050
public class OpenCloseTest {
51-
private static final String ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE = "org.eclipse.jdt.ui.JavaPerspective";
51+
private static final String ORG_ECLIPSE_RESOURCE_PERSPECTIVE = "org.eclipse.ui.resourcePerspective";
5252

5353
private static final int numIterations = 10;
5454

@@ -67,7 +67,7 @@ public void setup() {
6767
}
6868

6969
try {
70-
PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE, workbenchWindow);
70+
PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE, workbenchWindow);
7171
} catch (WorkbenchException e) {
7272
e.printStackTrace();
7373
}
@@ -101,7 +101,7 @@ public void testOpenCloseFile() throws CoreException {
101101
*/
102102
@Test
103103
public void testOpenCloseWorkbenchWindow() throws WorkbenchException {
104-
IWorkbenchWindow secondWorkbenchWindow = null;
104+
IWorkbenchWindow secondWorkbenchWindow;
105105
for (int index = 0; index < numIterations; index++) {
106106
secondWorkbenchWindow = PlatformUI.getWorkbench()
107107
.openWorkbenchWindow(ResourcesPlugin.getWorkspace().getRoot());
@@ -119,15 +119,15 @@ public void testOpenClosePerspective() {
119119

120120
HashMap<String, String> parameters = new HashMap<>();
121121
parameters.put(IWorkbenchCommandConstants.WINDOW_CLOSE_PERSPECTIVE_PARM_ID,
122-
ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE);
122+
ORG_ECLIPSE_RESOURCE_PERSPECTIVE);
123123

124124
ParameterizedCommand pCommand = ParameterizedCommand.generateCommand(command, parameters);
125125

126126
IHandlerService handlerService = workbenchWindow.getService(IHandlerService.class);
127127

128128
for (int index = 0; index < numIterations; index++) {
129129
try {
130-
PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE, workbenchWindow);
130+
PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE, workbenchWindow);
131131
try {
132132
handlerService.executeCommand(pCommand, null);
133133
} catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e1) {
@@ -143,8 +143,8 @@ public void testOpenClosePerspective() {
143143
*/
144144
@Test
145145
public void testOpenCloseView() throws WorkbenchException {
146-
IViewPart consoleView = null;
147-
IWorkbenchPage page = PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE,
146+
IViewPart consoleView;
147+
IWorkbenchPage page = PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE,
148148
workbenchWindow);
149149
for (int index = 0; index < numIterations; index++) {
150150
consoleView = page.showView(IPageLayout.ID_MINIMAP_VIEW);
@@ -157,7 +157,7 @@ public void testOpenCloseView() throws WorkbenchException {
157157
*/
158158
@Test
159159
public void testOpenCloseIntro() {
160-
IIntroPart introPart = null;
160+
IIntroPart introPart;
161161
for (int index = 0; index < numIterations; index++) {
162162
introPart = PlatformUI.getWorkbench().getIntroManager().showIntro(workbenchWindow, false);
163163
PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);

tests/org.eclipse.ui.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="3.14.0",
4040
org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.0",
4141
org.mockito.mockito-core;bundle-version="2.13.0",
4242
org.eclipse.ui.views.log;bundle-version="1.2.1300",
43-
org.eclipse.jdt.ui,
4443
org.eclipse.ui.navigator;bundle-version="3.12.100",
4544
org.eclipse.search,
45+
org.eclipse.debug.ui,
4646
org.eclipse.emf.ecore
4747
Import-Package: jakarta.annotation,
4848
jakarta.inject,

tests/org.eclipse.ui.tests/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@
723723
extensions="icontest1"/>
724724
<editor
725725
class="org.eclipse.ui.tests.api.MockEditorPart"
726-
icon="platform:/plugin/org.eclipse.jdt.ui/icons/full/obj16/class_obj.png"
726+
icon="platform:/plugin/org.eclipse.debug.ui/icons/full/obj16/file_obj.png"
727727
default="true"
728728
name="Plugin Icon Test 2"
729729
id="org.eclipse.ui.tests.IconTestEditor2"

0 commit comments

Comments
 (0)