Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameGlobalVariableProcessorTest.java

Issue 12340077: Initial binding of RenameRefactoring service to Eclipse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
11 * or implied. See the License for the specific language governing permissions a nd limitations under 11 * or implied. See the License for the specific language governing permissions a nd limitations under
12 * the License. 12 * the License.
13 */ 13 */
14 package com.google.dart.tools.ui.refactoring; 14 package com.google.dart.tools.ui.refactoring;
15 15
16 import com.google.dart.tools.core.model.CompilationUnit; 16 import com.google.dart.tools.core.model.CompilationUnit;
17 import com.google.dart.tools.core.model.DartVariableDeclaration; 17 import com.google.dart.tools.core.model.DartVariableDeclaration;
18 import com.google.dart.tools.internal.corext.refactoring.rename.RenameGlobalVari ableProcessor; 18 import com.google.dart.tools.internal.corext.refactoring.rename.RenameGlobalVari ableProcessor;
19 import com.google.dart.tools.ui.internal.refactoring.RenameSupport; 19 import com.google.dart.tools.ui.internal.refactoring.RenameSupport_OLD;
20 20
21 import org.eclipse.ltk.core.refactoring.RefactoringStatus; 21 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
22 import org.eclipse.ui.IWorkbenchWindow; 22 import org.eclipse.ui.IWorkbenchWindow;
23 import org.eclipse.ui.PlatformUI; 23 import org.eclipse.ui.PlatformUI;
24 24
25 import static org.fest.assertions.Assertions.assertThat; 25 import static org.fest.assertions.Assertions.assertThat;
26 26
27 /** 27 /**
28 * Test for {@link RenameGlobalVariableProcessor}. 28 * Test for {@link RenameGlobalVariableProcessor}.
29 */ 29 */
30 public final class RenameGlobalVariableProcessorTest extends RefactoringTest { 30 public final class RenameGlobalVariableProcessorTest extends RefactoringTest {
31 /** 31 /**
32 * Uses {@link RenameSupport} to rename {@link DartVariableDeclaration}. 32 * Uses {@link RenameSupport_OLD} to rename {@link DartVariableDeclaration}.
33 */ 33 */
34 private static void renameVariable(DartVariableDeclaration variable, String ne wName) 34 private static void renameVariable(DartVariableDeclaration variable, String ne wName)
35 throws Exception { 35 throws Exception {
36 RenameSupport renameSupport = RenameSupport.create(variable, newName); 36 RenameSupport_OLD renameSupport = RenameSupport_OLD.create(variable, newName );
37 IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbe nchWindow(); 37 IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbe nchWindow();
38 renameSupport.perform(workbenchWindow.getShell(), workbenchWindow); 38 renameSupport.perform(workbenchWindow.getShell(), workbenchWindow);
39 } 39 }
40 40
41 /** 41 /**
42 * Just for coverage of {@link RenameGlobalVariableProcessor} accessors. 42 * Just for coverage of {@link RenameGlobalVariableProcessor} accessors.
43 */ 43 */
44 public void test_accessors() throws Exception { 44 public void test_accessors() throws Exception {
45 setTestUnitContent( 45 setTestUnitContent(
46 "// filler filler filler filler filler filler filler filler filler fille r", 46 "// filler filler filler filler filler filler filler filler filler fille r",
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 // error should be displayed 545 // error should be displayed
546 assertThat(openInformationMessages).isEmpty(); 546 assertThat(openInformationMessages).isEmpty();
547 assertThat(showStatusMessages).hasSize(1); 547 assertThat(showStatusMessages).hasSize(1);
548 assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue() ); 548 assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue() );
549 assertEquals("File 'Test/" + unitName + "' in library 'Test' already declare s top-level " 549 assertEquals("File 'Test/" + unitName + "' in library 'Test' already declare s top-level "
550 + shadowName + " 'newName'", showStatusMessages.get(0)); 550 + shadowName + " 'newName'", showStatusMessages.get(0));
551 // no source changes 551 // no source changes
552 assertEquals(source, testUnit.getSource()); 552 assertEquals(source, testUnit.getSource());
553 } 553 }
554 } 554 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698