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

Side by Side Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/index/file/FileNodeManagerTest.java

Issue 587743002: Version 1.7.0-dev.3.2 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, the Dart project authors. 2 * Copyright (c) 2014, 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 verify(fileManager).delete(name); 196 verify(fileManager).delete(name);
197 } 197 }
198 198
199 @Override 199 @Override
200 protected void setUp() throws Exception { 200 protected void setUp() throws Exception {
201 super.setUp(); 201 super.setUp();
202 when(contextCodec.encode(context)).thenReturn(contextId); 202 when(contextCodec.encode(context)).thenReturn(contextId);
203 when(contextCodec.decode(contextId)).thenReturn(context); 203 when(contextCodec.decode(contextId)).thenReturn(context);
204 } 204 }
205 205
206 @Override
207 protected void tearDown() throws Exception {
208 fileManager = null;
209 stringCodec = null;
210 elementCodec = null;
211 relationshipCodec = null;
212 nodeManager = null;
213 super.tearDown();
214 }
215
206 private void assertHasLocation(Location[] locations, Element element, int offs et, int length) { 216 private void assertHasLocation(Location[] locations, Element element, int offs et, int length) {
207 for (Location location : locations) { 217 for (Location location : locations) {
208 if (Objects.equal(location.getElement(), element) && location.getOffset() == offset 218 if (Objects.equal(location.getElement(), element) && location.getOffset() == offset
209 && location.getLength() == length) { 219 && location.getLength() == length) {
210 return; 220 return;
211 } 221 }
212 } 222 }
213 fail("Expected to find Location(element=" + element + ", offset=" + offset + ", length=" 223 fail("Expected to find Location(element=" + element + ", offset=" + offset + ", length="
214 + length + ")"); 224 + length + ")");
215 } 225 }
216 226
217 private Element mockElement() { 227 private Element mockElement() {
218 int elementId = nextElementId++; 228 int elementId = nextElementId++;
219 Element element = mock(Element.class); 229 Element element = mock(Element.class);
220 when(elementCodec.encode(element)).thenReturn(elementId); 230 when(elementCodec.encode(element)).thenReturn(elementId);
221 when(elementCodec.decode(context, elementId)).thenReturn(element); 231 when(elementCodec.decode(context, elementId)).thenReturn(element);
222 return element; 232 return element;
223 } 233 }
224 } 234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698