| OLD | NEW |
| 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.DartFunction; | 17 import com.google.dart.tools.core.model.DartFunction; |
| 18 import com.google.dart.tools.internal.corext.refactoring.rename.RenameFunctionPr
ocessor; | 18 import com.google.dart.tools.internal.corext.refactoring.rename.RenameFunctionPr
ocessor; |
| 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 RenameFunctionProcessor}. | 28 * Test for {@link RenameFunctionProcessor}. |
| 29 */ | 29 */ |
| 30 public final class RenameFunctionProcessorTest extends RefactoringTest { | 30 public final class RenameFunctionProcessorTest extends RefactoringTest { |
| 31 /** | 31 /** |
| 32 * Uses {@link RenameSupport} to rename {@link DartFunction}. | 32 * Uses {@link RenameSupport_OLD} to rename {@link DartFunction}. |
| 33 */ | 33 */ |
| 34 private static void renameFunction(DartFunction function, String newName) thro
ws Exception { | 34 private static void renameFunction(DartFunction function, String newName) thro
ws Exception { |
| 35 RenameSupport renameSupport = RenameSupport.create(function, newName); | 35 RenameSupport_OLD renameSupport = RenameSupport_OLD.create(function, newName
); |
| 36 IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbe
nchWindow(); | 36 IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbe
nchWindow(); |
| 37 renameSupport.perform(workbenchWindow.getShell(), workbenchWindow); | 37 renameSupport.perform(workbenchWindow.getShell(), workbenchWindow); |
| 38 } | 38 } |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Just for coverage of {@link RenameFunctionProcessor} accessors. | 41 * Just for coverage of {@link RenameFunctionProcessor} accessors. |
| 42 */ | 42 */ |
| 43 public void test_accessors() throws Exception { | 43 public void test_accessors() throws Exception { |
| 44 setTestUnitContent( | 44 setTestUnitContent( |
| 45 "// filler filler filler filler filler filler filler filler filler fille
r", | 45 "// filler filler filler filler filler filler filler filler filler fille
r", |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // error should be displayed | 592 // error should be displayed |
| 593 assertThat(openInformationMessages).isEmpty(); | 593 assertThat(openInformationMessages).isEmpty(); |
| 594 assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue()
); | 594 assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue()
); |
| 595 assertThat(showStatusMessages).hasSize(1); | 595 assertThat(showStatusMessages).hasSize(1); |
| 596 assertEquals("File 'Test/" + unitName + "' in library 'Test' already declare
s top-level " | 596 assertEquals("File 'Test/" + unitName + "' in library 'Test' already declare
s top-level " |
| 597 + shadowName + " 'newName'", showStatusMessages.get(0)); | 597 + shadowName + " 'newName'", showStatusMessages.get(0)); |
| 598 // no source changes | 598 // no source changes |
| 599 assertEquals(source, testUnit.getSource()); | 599 assertEquals(source, testUnit.getSource()); |
| 600 } | 600 } |
| 601 } | 601 } |
| OLD | NEW |