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.analysis.get_errors; | 5 library test.analysis.get_errors; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/domain_analysis.dart'; | 10 import 'package:analysis_server/src/domain_analysis.dart'; |
| 11 import 'package:test/test.dart'; |
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
12 import 'package:unittest/unittest.dart'; | |
13 | 13 |
14 import '../analysis_abstract.dart'; | 14 import '../analysis_abstract.dart'; |
15 import '../utils.dart'; | 15 import '../utils.dart'; |
16 | 16 |
17 main() { | 17 main() { |
18 initializeTestEnvironment(); | 18 initializeTestEnvironment(); |
19 defineReflectiveTests(GetErrorsTest); | 19 defineReflectiveSuite(() { |
| 20 defineReflectiveTests(GetErrorsTest); |
| 21 }); |
20 } | 22 } |
21 | 23 |
22 @reflectiveTest | 24 @reflectiveTest |
23 class GetErrorsTest extends AbstractAnalysisTest { | 25 class GetErrorsTest extends AbstractAnalysisTest { |
24 static const String requestId = 'test-getError'; | 26 static const String requestId = 'test-getError'; |
25 | 27 |
26 @override | 28 @override |
27 void setUp() { | 29 void setUp() { |
28 super.setUp(); | 30 super.setUp(); |
29 server.handlers = [new AnalysisDomainHandler(server),]; | 31 server.handlers = [ |
| 32 new AnalysisDomainHandler(server), |
| 33 ]; |
30 createProject(); | 34 createProject(); |
31 } | 35 } |
32 | 36 |
33 test_afterAnalysisComplete() async { | 37 test_afterAnalysisComplete() async { |
34 addTestFile(''' | 38 addTestFile(''' |
35 main() { | 39 main() { |
36 print(42) | 40 print(42) |
37 } | 41 } |
38 '''); | 42 '''); |
39 await waitForTasksFinished(); | 43 await waitForTasksFinished(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 Request _createGetErrorsRequest(String file) { | 143 Request _createGetErrorsRequest(String file) { |
140 return new AnalysisGetErrorsParams(file).toRequest(requestId); | 144 return new AnalysisGetErrorsParams(file).toRequest(requestId); |
141 } | 145 } |
142 | 146 |
143 Future<List<AnalysisError>> _getErrors(String file) async { | 147 Future<List<AnalysisError>> _getErrors(String file) async { |
144 Request request = _createGetErrorsRequest(file); | 148 Request request = _createGetErrorsRequest(file); |
145 Response response = await serverChannel.sendRequest(request); | 149 Response response = await serverChannel.sendRequest(request); |
146 return new AnalysisGetErrorsResult.fromResponse(response).errors; | 150 return new AnalysisGetErrorsResult.fromResponse(response).errors; |
147 } | 151 } |
148 } | 152 } |
OLD | NEW |