| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |