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.notification_errors; | 5 library test.analysis.notification_errors; |
6 | 6 |
7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
8 import 'package:analysis_server/src/domain_analysis.dart'; | 8 import 'package:analysis_server/src/domain_analysis.dart'; |
9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
11 | 11 |
12 import '../analysis_abstract.dart'; | 12 import '../analysis_abstract.dart'; |
13 import '../reflective_tests.dart'; | 13 import '../reflective_tests.dart'; |
14 | 14 |
15 | 15 |
16 main() { | 16 main() { |
17 groupSep = ' | '; | 17 groupSep = ' | '; |
18 runReflectiveTests(NotificationErrorsTest); | 18 runReflectiveTests(NotificationErrorsTest); |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 @ReflectiveTestCase() | 22 @reflectiveTest |
23 class NotificationErrorsTest extends AbstractAnalysisTest { | 23 class NotificationErrorsTest extends AbstractAnalysisTest { |
24 Map<String, List<AnalysisError>> filesErrors = {}; | 24 Map<String, List<AnalysisError>> filesErrors = {}; |
25 | 25 |
26 void processNotification(Notification notification) { | 26 void processNotification(Notification notification) { |
27 if (notification.event == ANALYSIS_ERRORS) { | 27 if (notification.event == ANALYSIS_ERRORS) { |
28 var decoded = new AnalysisErrorsParams.fromNotification(notification); | 28 var decoded = new AnalysisErrorsParams.fromNotification(notification); |
29 filesErrors[decoded.file] = decoded.errors; | 29 filesErrors[decoded.file] = decoded.errors; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 '''); | 77 '''); |
78 return waitForTasksFinished().then((_) { | 78 return waitForTasksFinished().then((_) { |
79 List<AnalysisError> errors = filesErrors[testFile]; | 79 List<AnalysisError> errors = filesErrors[testFile]; |
80 expect(errors, hasLength(1)); | 80 expect(errors, hasLength(1)); |
81 AnalysisError error = errors[0]; | 81 AnalysisError error = errors[0]; |
82 expect(error.severity, AnalysisErrorSeverity.WARNING); | 82 expect(error.severity, AnalysisErrorSeverity.WARNING); |
83 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 83 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
84 }); | 84 }); |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |