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 }
@@ -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 }
0 commit comments