4848 * Test opening and closing of items.
4949 */
5050public 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 );
0 commit comments