| Index: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
|
| index a476ca6d872a9e0c41b7e1e59886355d7889b7e0..de71245d4f669cf414f735afca20ba6d44678260 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
|
| @@ -156,6 +156,36 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
|
| "}");
|
| }
|
|
|
| + public void test_OK_getter() throws Exception {
|
| + setTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " int get test() {",
|
| + " return 42;",
|
| + " }",
|
| + "}",
|
| + "f() {",
|
| + " A a = new A();",
|
| + " print(a.test);",
|
| + "}",
|
| + "");
|
| + Method method = findElement("test() {");
|
| + // do rename
|
| + renameMethod(method, "newName");
|
| + assertTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " int get newName() {",
|
| + " return 42;",
|
| + " }",
|
| + "}",
|
| + "f() {",
|
| + " A a = new A();",
|
| + " print(a.newName);",
|
| + "}",
|
| + "");
|
| + }
|
| +
|
| public void test_OK_multipleUnits_onReference() throws Exception {
|
| setUnitContent(
|
| "Test1.dart",
|
| @@ -319,6 +349,34 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
|
| "");
|
| }
|
|
|
| + public void test_OK_setter() throws Exception {
|
| + setTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " void set test(x) {",
|
| + " }",
|
| + "}",
|
| + "f() {",
|
| + " A a = new A();",
|
| + " a.test = 42;",
|
| + "}",
|
| + "");
|
| + Method method = findElement("test = 42;");
|
| + // do rename
|
| + renameMethod(method, "newName");
|
| + assertTestUnitContent(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {",
|
| + " void set newName(x) {",
|
| + " }",
|
| + "}",
|
| + "f() {",
|
| + " A a = new A();",
|
| + " a.newName = 42;",
|
| + "}",
|
| + "");
|
| + }
|
| +
|
| public void test_OK_singleUnit_onDeclaration() throws Exception {
|
| setTestUnitContent(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
|
|