48
48
* Test opening and closing of items.
49
49
*/
50
50
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 " ;
52
52
53
53
private static final int numIterations = 10 ;
54
54
@@ -67,7 +67,7 @@ public void setup() {
67
67
}
68
68
69
69
try {
70
- PlatformUI .getWorkbench ().showPerspective (ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE , workbenchWindow );
70
+ PlatformUI .getWorkbench ().showPerspective (ORG_ECLIPSE_RESOURCE_PERSPECTIVE , workbenchWindow );
71
71
} catch (WorkbenchException e ) {
72
72
e .printStackTrace ();
73
73
}
@@ -101,7 +101,7 @@ public void testOpenCloseFile() throws CoreException {
101
101
*/
102
102
@ Test
103
103
public void testOpenCloseWorkbenchWindow () throws WorkbenchException {
104
- IWorkbenchWindow secondWorkbenchWindow = null ;
104
+ IWorkbenchWindow secondWorkbenchWindow ;
105
105
for (int index = 0 ; index < numIterations ; index ++) {
106
106
secondWorkbenchWindow = PlatformUI .getWorkbench ()
107
107
.openWorkbenchWindow (ResourcesPlugin .getWorkspace ().getRoot ());
@@ -119,15 +119,15 @@ public void testOpenClosePerspective() {
119
119
120
120
HashMap <String , String > parameters = new HashMap <>();
121
121
parameters .put (IWorkbenchCommandConstants .WINDOW_CLOSE_PERSPECTIVE_PARM_ID ,
122
- ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE );
122
+ ORG_ECLIPSE_RESOURCE_PERSPECTIVE );
123
123
124
124
ParameterizedCommand pCommand = ParameterizedCommand .generateCommand (command , parameters );
125
125
126
126
IHandlerService handlerService = workbenchWindow .getService (IHandlerService .class );
127
127
128
128
for (int index = 0 ; index < numIterations ; index ++) {
129
129
try {
130
- PlatformUI .getWorkbench ().showPerspective (ORG_ECLIPSE_JDT_UI_JAVA_PERSPECTIVE , workbenchWindow );
130
+ PlatformUI .getWorkbench ().showPerspective (ORG_ECLIPSE_RESOURCE_PERSPECTIVE , workbenchWindow );
131
131
try {
132
132
handlerService .executeCommand (pCommand , null );
133
133
} catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e1 ) {
@@ -143,8 +143,8 @@ public void testOpenClosePerspective() {
143
143
*/
144
144
@ Test
145
145
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 ,
148
148
workbenchWindow );
149
149
for (int index = 0 ; index < numIterations ; index ++) {
150
150
consoleView = page .showView (IPageLayout .ID_MINIMAP_VIEW );
@@ -157,7 +157,7 @@ public void testOpenCloseView() throws WorkbenchException {
157
157
*/
158
158
@ Test
159
159
public void testOpenCloseIntro () {
160
- IIntroPart introPart = null ;
160
+ IIntroPart introPart ;
161
161
for (int index = 0 ; index < numIterations ; index ++) {
162
162
introPart = PlatformUI .getWorkbench ().getIntroManager ().showIntro (workbenchWindow , false );
163
163
PlatformUI .getWorkbench ().getIntroManager ().closeIntro (introPart );
0 commit comments