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

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

Issue 11273064: Issue 5887. Parts must start with 'part of'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameImportProcessorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameImportProcessorTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameImportProcessorTest.java
index 82e1de60ce709195eb2ea14a3a9fb4b5a4fc5041..cbb66c495f788f499a4bb146cd2238b504606c5f 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameImportProcessorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/RenameImportProcessorTest.java
@@ -103,25 +103,25 @@ public final class RenameImportProcessorTest extends RefactoringTest {
public void test_OK_multipleUnits_onReference() throws Exception {
prepareUniqueLibraries();
- setUnitContent(
- "Test1.dart",
+ setUnitContent("Test1.dart", new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of Test;",
"foo1() {",
" test.A a;",
" test.B b;",
"}",
- "");
- setUnitContent(
- "Test2.dart",
+ ""});
+ setUnitContent("Test2.dart", new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of Test;",
"foo2() {",
" test.A a;",
" test.B b;",
"}",
- "");
+ ""});
setTestUnitContent(
"// filler filler filler filler filler filler filler filler filler filler",
- "#library('Test');",
+ "library Test;",
"#import('LibA.dart', prefix: 'test');",
"#import('LibB.dart', prefix: 'test');",
"#source('Test1.dart');",
@@ -135,28 +135,28 @@ public final class RenameImportProcessorTest extends RefactoringTest {
renameImport(imprt, "newName");
assertTestUnitContent(
"// filler filler filler filler filler filler filler filler filler filler",
- "#library('Test');",
+ "library Test;",
"#import('LibA.dart', prefix: 'newName');",
"#import('LibB.dart', prefix: 'test');",
"#source('Test1.dart');",
"#source('Test2.dart');",
"");
- assertUnitContent(
- unit1,
+ assertUnitContent(unit1, new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of Test;",
"foo1() {",
" newName.A a;",
" test.B b;",
"}",
- "");
- assertUnitContent(
- unit2,
+ ""});
+ assertUnitContent(unit2, new String[] {
"// filler filler filler filler filler filler filler filler filler filler",
+ "part of Test;",
"foo2() {",
" newName.A a;",
" test.B b;",
"}",
- "");
+ ""});
}
public void test_OK_singleUnit_onDeclaration() throws Exception {
@@ -693,8 +693,11 @@ public final class RenameImportProcessorTest extends RefactoringTest {
assertThat(openInformationMessages).isEmpty();
assertThat(showStatusMessages).hasSize(1);
assertEquals(RefactoringStatus.ERROR, showStatusSeverities.get(0).intValue());
- assertEquals("File 'Test/" + unitName + "' in library 'Test' already declares top-level "
- + shadowName + " 'newName'", showStatusMessages.get(0));
+ assertEquals("File 'Test/"
+ + unitName
+ + "' in library 'Test' already declares top-level "
+ + shadowName
+ + " 'newName'", showStatusMessages.get(0));
// no source changes
assertEquals(source, testUnit.getSource());
}
@@ -707,14 +710,14 @@ public final class RenameImportProcessorTest extends RefactoringTest {
"LibA.dart",
makeSource(
"// filler filler filler filler filler filler filler filler filler filler",
- "#library('A');",
+ "library libA;",
"class A {}",
"")).getResource();
testProject.setUnitContent(
"LibB.dart",
makeSource(
"// filler filler filler filler filler filler filler filler filler filler",
- "#library('B');",
+ "library libB;",
"class B {}",
"")).getResource();
}

Powered by Google App Engine
This is Rietveld 408576698