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 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 "By convention, method names usually start with a lowercase letter", | 149 "By convention, method names usually start with a lowercase letter", |
150 showStatusMessages.get(0)); | 150 showStatusMessages.get(0)); |
151 // status was warning, so rename was done | 151 // status was warning, so rename was done |
152 assertTestUnitContent( | 152 assertTestUnitContent( |
153 "// filler filler filler filler filler filler filler filler filler fille
r", | 153 "// filler filler filler filler filler filler filler filler filler fille
r", |
154 "class A {", | 154 "class A {", |
155 " NewName() {}", | 155 " NewName() {}", |
156 "}"); | 156 "}"); |
157 } | 157 } |
158 | 158 |
| 159 public void test_methodCall() throws Exception { |
| 160 setTestUnitContent( |
| 161 "// filler filler filler filler filler filler filler filler filler fille
r", |
| 162 "class A {", |
| 163 " call() {}", |
| 164 "}"); |
| 165 Method method = findElement("call() {}"); |
| 166 // try to rename |
| 167 try { |
| 168 renameMethod(method, "newName"); |
| 169 fail(); |
| 170 } catch (InterruptedException e) { |
| 171 } |
| 172 // error should be displayed |
| 173 assertThat(openInformationMessages).isEmpty(); |
| 174 assertThat(showStatusMessages).hasSize(1); |
| 175 assertEquals(RefactoringStatus.FATAL, showStatusSeverities.get(0).intValue()
); |
| 176 assertEquals("Method 'call' cannot be renamed", showStatusMessages.get(0)); |
| 177 } |
| 178 |
159 public void test_OK_getter() throws Exception { | 179 public void test_OK_getter() throws Exception { |
160 setTestUnitContent( | 180 setTestUnitContent( |
161 "// filler filler filler filler filler filler filler filler filler fille
r", | 181 "// filler filler filler filler filler filler filler filler filler fille
r", |
162 "class A {", | 182 "class A {", |
163 " int get test() {", | 183 " int get test() {", |
164 " return 42;", | 184 " return 42;", |
165 " }", | 185 " }", |
166 "}", | 186 "}", |
167 "f() {", | 187 "f() {", |
168 " A a = new A();", | 188 " A a = new A();", |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 "// filler filler filler filler filler filler filler filler filler fille
r", | 795 "// filler filler filler filler filler filler filler filler filler fille
r", |
776 "class A {", | 796 "class A {", |
777 " newName(var p) {}", | 797 " newName(var p) {}", |
778 " f1() {", | 798 " f1() {", |
779 " newName(0);", | 799 " newName(0);", |
780 " }", | 800 " }", |
781 "}", | 801 "}", |
782 "somethingBad"); | 802 "somethingBad"); |
783 } | 803 } |
784 } | 804 } |
OLD | NEW |