| 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 import 'package:analysis_server/protocol/protocol.dart'; | 5 import 'package:analysis_server/protocol/protocol.dart'; |
| 6 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 6 import 'package:analysis_server/protocol/protocol_generated.dart'; | 7 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 7 import 'package:analysis_server/src/constants.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/domain_analysis.dart'; | 9 import 'package:analysis_server/src/domain_analysis.dart'; |
| 10 import 'package:analyzer/src/dart/analysis/driver.dart'; | 10 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 11 import 'package:analyzer/src/lint/linter.dart'; | 11 import 'package:analyzer/src/lint/linter.dart'; |
| 12 import 'package:analyzer/src/services/lint.dart'; | 12 import 'package:analyzer/src/services/lint.dart'; |
| 13 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 13 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| 14 import 'package:linter/src/rules.dart'; | 14 import 'package:linter/src/rules.dart'; |
| 15 import 'package:test/test.dart'; | 15 import 'package:test/test.dart'; |
| 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 17 | 17 |
| 18 import '../analysis_abstract.dart'; | 18 import '../analysis_abstract.dart'; |
| 19 import '../mocks.dart'; | 19 import '../mocks.dart'; |
| 20 | 20 |
| 21 main() { | 21 main() { |
| 22 defineReflectiveSuite(() { | 22 defineReflectiveSuite(() { |
| 23 defineReflectiveTests(NotificationErrorsTest); | 23 defineReflectiveTests(NotificationErrorsTest); |
| 24 }); | 24 }); |
| 25 } | 25 } |
| 26 | 26 |
| 27 @reflectiveTest | 27 @reflectiveTest |
| 28 class NotificationErrorsTest extends AbstractAnalysisTest { | 28 class NotificationErrorsTest extends AbstractAnalysisTest { |
| 29 Map<String, List<AnalysisError>> filesErrors = {}; | 29 Map<String, List<AnalysisError>> filesErrors = {}; |
| 30 | 30 |
| 31 void processNotification(Notification notification) { | 31 void processNotification(Notification notification) { |
| 32 if (notification.event == ANALYSIS_ERRORS) { | 32 if (notification.event == ANALYSIS_NOTIFICATION_ERRORS) { |
| 33 var decoded = new AnalysisErrorsParams.fromNotification(notification); | 33 var decoded = new AnalysisErrorsParams.fromNotification(notification); |
| 34 filesErrors[decoded.file] = decoded.errors; | 34 filesErrors[decoded.file] = decoded.errors; |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 @override | 38 @override |
| 39 void setUp() { | 39 void setUp() { |
| 40 generateSummaryFiles = true; | 40 generateSummaryFiles = true; |
| 41 registerLintRules(); | 41 registerLintRules(); |
| 42 super.setUp(); | 42 super.setUp(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 '''); | 139 '''); |
| 140 await waitForTasksFinished(); | 140 await waitForTasksFinished(); |
| 141 await pumpEventQueue(); | 141 await pumpEventQueue(); |
| 142 List<AnalysisError> errors = filesErrors[testFile]; | 142 List<AnalysisError> errors = filesErrors[testFile]; |
| 143 expect(errors, hasLength(1)); | 143 expect(errors, hasLength(1)); |
| 144 AnalysisError error = errors[0]; | 144 AnalysisError error = errors[0]; |
| 145 expect(error.severity, AnalysisErrorSeverity.WARNING); | 145 expect(error.severity, AnalysisErrorSeverity.WARNING); |
| 146 expect(error.type, AnalysisErrorType.STATIC_WARNING); | 146 expect(error.type, AnalysisErrorType.STATIC_WARNING); |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |