Index: editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/refactoring/ExtractMethodRefactoringImplTest.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/refactoring/ExtractMethodRefactoringImplTest.java (revision 40507) |
+++ editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/internal/refactoring/ExtractMethodRefactoringImplTest.java (working copy) |
@@ -143,6 +143,26 @@ |
findRangeIdentifier("res() {} // marker")); |
} |
+ public void test_bad_conflict_topLevel_alreadyDeclaresFunction() throws Exception { |
+ parseTestUnit( |
+ "// filler filler filler filler filler filler filler filler filler filler", |
+ "void res() {}", |
+ "main() {", |
+ "// start", |
+ " print(0);", |
+ "// end", |
+ "}", |
+ ""); |
+ setSelectionFromStartEndComments(); |
+ createRefactoring(); |
+ // check conditions |
+ assertRefactoringStatus( |
+ refactoringStatus, |
+ RefactoringStatusSeverity.ERROR, |
+ "Library already declares function with name 'res'.", |
+ findRangeIdentifier("res() {}")); |
+ } |
+ |
// TODO(scheglov) waiting for "library namespace" in Engine |
// public void test_bad_conflict_method_willHideTopLevel() throws Exception { |
// indexTestUnit( |
@@ -176,26 +196,6 @@ |
//// } |
// } |
- public void test_bad_conflict_topLevel_alreadyDeclaresFunction() throws Exception { |
- parseTestUnit( |
- "// filler filler filler filler filler filler filler filler filler filler", |
- "void res() {}", |
- "main() {", |
- "// start", |
- " print(0);", |
- "// end", |
- "}", |
- ""); |
- setSelectionFromStartEndComments(); |
- createRefactoring(); |
- // check conditions |
- assertRefactoringStatus( |
- refactoringStatus, |
- RefactoringStatusSeverity.ERROR, |
- "Library already declares function with name 'res'.", |
- findRangeIdentifier("res() {}")); |
- } |
- |
public void test_bad_conflict_topLevel_willHideInheritedMemberUsage() throws Exception { |
indexTestUnit( |
"// filler filler filler filler filler filler filler filler filler filler", |
@@ -2560,6 +2560,13 @@ |
assertTestChangeResult(change, makeSource(lines)); |
} |
+ @Override |
+ protected void tearDown() throws Exception { |
+ refactoring = null; |
+ refactoringStatus = null; |
+ super.tearDown(); |
+ } |
+ |
/** |
* Creates {@link ExtractMethodRefactoring} in {@link #refactoring}. |
*/ |