OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.operation.queue; | 5 library test.operation.queue; |
6 | 6 |
7 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
8 import 'package:analysis_server/src/context_manager.dart'; | 8 import 'package:analysis_server/src/context_manager.dart'; |
9 import 'package:analysis_server/src/operation/operation.dart'; | 9 import 'package:analysis_server/src/operation/operation.dart'; |
10 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 10 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
11 import 'package:analysis_server/src/operation/operation_queue.dart'; | 11 import 'package:analysis_server/src/operation/operation_queue.dart'; |
12 import 'package:analysis_server/src/services/search/search_engine.dart'; | 12 import 'package:analysis_server/src/services/search/search_engine.dart'; |
13 import 'package:analyzer/file_system/file_system.dart'; | 13 import 'package:analyzer/file_system/file_system.dart'; |
14 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 16 import 'package:test/test.dart'; |
16 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 17 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
17 import 'package:typed_mock/typed_mock.dart'; | 18 import 'package:typed_mock/typed_mock.dart'; |
18 import 'package:unittest/unittest.dart'; | |
19 | 19 |
20 import '../mocks.dart'; | 20 import '../mocks.dart'; |
21 import '../utils.dart'; | 21 import '../utils.dart'; |
22 | 22 |
23 main() { | 23 main() { |
24 initializeTestEnvironment(); | 24 initializeTestEnvironment(); |
25 defineReflectiveTests(ServerOperationQueueTest); | 25 defineReflectiveSuite(() { |
| 26 defineReflectiveTests(ServerOperationQueueTest); |
| 27 }); |
26 } | 28 } |
27 | 29 |
28 /** | 30 /** |
29 * Return a [ServerOperation] mock with the given priority. | 31 * Return a [ServerOperation] mock with the given priority. |
30 */ | 32 */ |
31 ServerOperation mockOperation(ServerOperationPriority priority) { | 33 ServerOperation mockOperation(ServerOperationPriority priority) { |
32 ServerOperation operation = new _ServerOperationMock(); | 34 ServerOperation operation = new _ServerOperationMock(); |
33 when(operation.priority).thenReturn(priority); | 35 when(operation.priority).thenReturn(priority); |
34 return operation; | 36 return operation; |
35 } | 37 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 @override | 245 @override |
244 ServerOperationPriority get priority { | 246 ServerOperationPriority get priority { |
245 return ServerOperationPriority.ANALYSIS_NOTIFICATION; | 247 return ServerOperationPriority.ANALYSIS_NOTIFICATION; |
246 } | 248 } |
247 | 249 |
248 @override | 250 @override |
249 bool shouldBeDiscardedOnSourceChange(Source source) { | 251 bool shouldBeDiscardedOnSourceChange(Source source) { |
250 return source == this.source; | 252 return source == this.source; |
251 } | 253 } |
252 } | 254 } |
OLD | NEW |