| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.domain.diagnostic; | 5 library test.domain.diagnostic; |
| 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/analysis_server.dart'; | 8 import 'package:analysis_server/src/analysis_server.dart'; |
| 9 import 'package:analysis_server/src/domain_diagnostic.dart'; | 9 import 'package:analysis_server/src/domain_diagnostic.dart'; |
| 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 10 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 11 import 'package:analyzer/file_system/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 12 import 'package:analyzer/instrumentation/instrumentation.dart'; | 12 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 13 import 'package:analyzer/src/generated/engine.dart'; | 13 import 'package:analyzer/src/generated/engine.dart'; |
| 14 import 'package:analyzer/src/generated/sdk.dart'; | 14 import 'package:analyzer/src/generated/sdk.dart'; |
| 15 import 'package:plugin/manager.dart'; | 15 import 'package:plugin/manager.dart'; |
| 16 import 'package:plugin/plugin.dart'; | 16 import 'package:plugin/plugin.dart'; |
| 17 import 'package:test/test.dart'; | 17 import 'package:test/test.dart'; |
| 18 | 18 |
| 19 import 'mock_sdk.dart'; | 19 import 'mock_sdk.dart'; |
| 20 import 'mocks.dart'; | 20 import 'mocks.dart'; |
| 21 import 'utils.dart'; | |
| 22 | 21 |
| 23 main() { | 22 main() { |
| 24 AnalysisServer server; | 23 AnalysisServer server; |
| 25 DiagnosticDomainHandler handler; | 24 DiagnosticDomainHandler handler; |
| 26 MemoryResourceProvider resourceProvider; | 25 MemoryResourceProvider resourceProvider; |
| 27 | 26 |
| 28 initializeTestEnvironment(); | |
| 29 | 27 |
| 30 setUp(() { | 28 setUp(() { |
| 31 // | 29 // |
| 32 // Collect plugins | 30 // Collect plugins |
| 33 // | 31 // |
| 34 ServerPlugin serverPlugin = new ServerPlugin(); | 32 ServerPlugin serverPlugin = new ServerPlugin(); |
| 35 List<Plugin> plugins = <Plugin>[]; | 33 List<Plugin> plugins = <Plugin>[]; |
| 36 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 34 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
| 37 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 35 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
| 38 plugins.add(AnalysisEngine.instance.optionsPlugin); | 36 plugins.add(AnalysisEngine.instance.optionsPlugin); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 }); | 84 }); |
| 87 | 85 |
| 88 test('getDiagnostics - (no root)', () async { | 86 test('getDiagnostics - (no root)', () async { |
| 89 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); | 87 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); |
| 90 var response = handler.handleRequest(request); | 88 var response = handler.handleRequest(request); |
| 91 Map json = response.toJson()[Response.RESULT]; | 89 Map json = response.toJson()[Response.RESULT]; |
| 92 expect(json['contexts'], hasLength(0)); | 90 expect(json['contexts'], hasLength(0)); |
| 93 }); | 91 }); |
| 94 }); | 92 }); |
| 95 } | 93 } |
| OLD | NEW |