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.set_priority_files; | 5 library test.analysis.set_priority_files; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
8 import 'package:analysis_server/src/domain_analysis.dart'; | 8 import 'package:analysis_server/src/domain_analysis.dart'; |
9 import 'package:analyzer/src/generated/engine.dart' | 9 import 'package:analyzer/src/generated/engine.dart' |
10 show InternalAnalysisContext; | 10 show InternalAnalysisContext; |
11 import 'package:analyzer/src/generated/source.dart'; | 11 import 'package:analyzer/src/generated/source.dart'; |
| 12 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart'; | |
14 | 14 |
15 import '../analysis_abstract.dart'; | 15 import '../analysis_abstract.dart'; |
16 import '../mocks.dart'; | 16 import '../mocks.dart'; |
17 import '../utils.dart'; | 17 import '../utils.dart'; |
18 | 18 |
19 main() { | 19 main() { |
20 initializeTestEnvironment(); | 20 initializeTestEnvironment(); |
21 defineReflectiveTests(SetPriorityFilesTest); | 21 defineReflectiveSuite(() { |
| 22 defineReflectiveTests(SetPriorityFilesTest); |
| 23 }); |
22 } | 24 } |
23 | 25 |
24 @reflectiveTest | 26 @reflectiveTest |
25 class SetPriorityFilesTest extends AbstractAnalysisTest { | 27 class SetPriorityFilesTest extends AbstractAnalysisTest { |
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_fileDoesNotExist() async { | 37 test_fileDoesNotExist() async { |
34 String file = '$projectPath/doesNotExist.dart'; | 38 String file = '$projectPath/doesNotExist.dart'; |
35 Response response = await _setPriorityFile(file); | 39 Response response = await _setPriorityFile(file); |
36 expect(response, isResponseSuccess('0')); | 40 expect(response, isResponseSuccess('0')); |
37 } | 41 } |
38 | 42 |
39 test_fileInAnalysisRoot() async { | 43 test_fileInAnalysisRoot() async { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 expect(response.error, isNotNull); | 127 expect(response.error, isNotNull); |
124 expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES); | 128 expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES); |
125 } | 129 } |
126 | 130 |
127 _setPriorityFile(String file) async { | 131 _setPriorityFile(String file) async { |
128 Request request = | 132 Request request = |
129 new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0'); | 133 new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0'); |
130 return await serverChannel.sendRequest(request); | 134 return await serverChannel.sendRequest(request); |
131 } | 135 } |
132 } | 136 } |
OLD | NEW |