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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
diff --git a/dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java b/dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
index e7d62ce1b6382eb659e42d1e1899c21a684499f8..920cf6bb148f262d0a676a3286e56b8f8d66e76a 100644
--- a/dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
+++ b/dart/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameMethodProcessorTest.java
@@ -204,40 +204,10 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
"");
}
- public void test_OK_inexactReferences() throws Exception {
- setTestUnitContent(
- "// filler filler filler filler filler filler filler filler filler filler",
- "class A {",
- " test() {}",
- "}",
- "f1(A a) {",
- " a.test();",
- "}",
- "f2(a) {",
- " a.test();",
- "}",
- "");
- Method method = findElement("test() {}");
- // do rename
- renameMethod(method, "newName");
- assertTestUnitContent(
- "// filler filler filler filler filler filler filler filler filler filler",
- "class A {",
- " newName() {}",
- "}",
- "f1(A a) {",
- " a.newName();",
- "}",
- "f2(a) {",
- " a.newName();",
- "}",
- "");
- }
-
public void test_OK_multipleUnits_onReference() throws Exception {
- setUnitContent("Test1.dart", new String[] {
+ setUnitContent(
+ "Test1.dart",
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"class A {",
" test(var p) {}",
" int bar = 2;",
@@ -245,28 +215,28 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
" test(3);",
" bar = 4;",
" }",
- "}"});
- setUnitContent("Test2.dart", new String[] {
+ "}");
+ setUnitContent(
+ "Test2.dart",
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"f2() {",
" A a = new A();",
" a.test(5);",
- "}"});
- setUnitContent("Test3.dart", new String[] {
+ "}");
+ setUnitContent(
+ "Test3.dart",
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"class B extends A {",
" f3() {",
" test(6);",
" }",
- "}"});
+ "}");
setTestUnitContent(
"// filler filler filler filler filler filler filler filler filler filler",
- "library test;",
- "part 'Test1.dart';",
- "part 'Test2.dart';",
- "part 'Test3.dart';");
+ "#library('test');",
+ "#source('Test1.dart');",
+ "#source('Test2.dart');",
+ "#source('Test3.dart');");
// get units, because they have not library
CompilationUnit unit1 = testProject.getUnit("Test1.dart");
CompilationUnit unit2 = testProject.getUnit("Test2.dart");
@@ -275,9 +245,9 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
Method method = findElement(unit2, "test(5);");
// do rename
renameMethod(method, "newName");
- assertUnitContent(unit1, new String[] {
+ assertUnitContent(
+ unit1,
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"class A {",
" newName(var p) {}",
" int bar = 2;",
@@ -285,22 +255,22 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
" newName(3);",
" bar = 4;",
" }",
- "}"});
- assertUnitContent(unit2, new String[] {
+ "}");
+ assertUnitContent(
+ unit2,
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"f2() {",
" A a = new A();",
" a.newName(5);",
- "}"});
- assertUnitContent(unit3, new String[] {
+ "}");
+ assertUnitContent(
+ unit3,
"// filler filler filler filler filler filler filler filler filler filler",
- "part of test;",
"class B extends A {",
" f3() {",
" newName(6);",
" }",
- "}"});
+ "}");
}
public void test_OK_namedConstructor_newName() throws Exception {
@@ -490,6 +460,36 @@ public final class RenameMethodProcessorTest extends RefactoringTest {
" }",
"}");
}
+
+ public void test_OK_inexactReferences() throws Exception {
+ setTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " test() {}",
+ "}",
+ "f1(A a) {",
+ " a.test();",
+ "}",
+ "f2(a) {",
+ " a.test();",
+ "}",
+ "");
+ Method method = findElement("test() {}");
+ // do rename
+ renameMethod(method, "newName");
+ assertTestUnitContent(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " newName() {}",
+ "}",
+ "f1(A a) {",
+ " a.newName();",
+ "}",
+ "f2(a) {",
+ " a.newName();",
+ "}",
+ "");
+ }
public void test_OK_singleUnit_onReference() throws Exception {
setTestUnitContent(

Powered by Google App Engine
This is Rietveld 408576698