Skip to content

Commit 9b3f6d5

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 d58c50e commit 9b3f6d5

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

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

Lines changed: 7 additions & 9 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
}
@@ -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,11 +143,10 @@ 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+
IWorkbenchPage page = PlatformUI.getWorkbench().showPerspective(ORG_ECLIPSE_RESOURCE_PERSPECTIVE,
148147
workbenchWindow);
149148
for (int index = 0; index < numIterations; index++) {
150-
consoleView = page.showView(IPageLayout.ID_MINIMAP_VIEW);
149+
IViewPart consoleView = page.showView(IPageLayout.ID_MINIMAP_VIEW);
151150
page.hideView(consoleView);
152151
}
153152
}
@@ -157,9 +156,8 @@ public void testOpenCloseView() throws WorkbenchException {
157156
*/
158157
@Test
159158
public void testOpenCloseIntro() {
160-
IIntroPart introPart = null;
161159
for (int index = 0; index < numIterations; index++) {
162-
introPart = PlatformUI.getWorkbench().getIntroManager().showIntro(workbenchWindow, false);
160+
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().showIntro(workbenchWindow, false);
163161
PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
164162
}
165163
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ 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,
4645
org.eclipse.emf.ecore

0 commit comments

Comments
 (0)