| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| 11 import 'package:analysis_server/src/domain_server.dart'; | 11 import 'package:analysis_server/src/domain_server.dart'; |
| 12 import 'package:analyzer/file_system/file_system.dart'; | 12 import 'package:analyzer/file_system/file_system.dart'; |
| 13 import 'package:analyzer/file_system/memory_file_system.dart'; | 13 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 14 import 'package:analyzer/instrumentation/instrumentation.dart'; | 14 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 15 import 'package:analyzer/src/generated/engine.dart'; | 15 import 'package:analyzer/src/generated/engine.dart'; |
| 16 import 'package:analyzer/src/generated/sdk.dart'; | 16 import 'package:analyzer/src/generated/sdk.dart'; |
| 17 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 17 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| 18 import 'package:plugin/manager.dart'; | 18 import 'package:plugin/manager.dart'; |
| 19 import 'package:plugin/plugin.dart'; | |
| 20 import 'package:test/test.dart'; | 19 import 'package:test/test.dart'; |
| 21 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 20 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 22 | 21 |
| 23 import 'mock_sdk.dart'; | 22 import 'mock_sdk.dart'; |
| 24 import 'mocks.dart'; | 23 import 'mocks.dart'; |
| 25 | 24 |
| 26 main() { | 25 main() { |
| 27 defineReflectiveSuite(() { | 26 defineReflectiveSuite(() { |
| 28 defineReflectiveTests(AnalysisServerTest); | 27 defineReflectiveTests(AnalysisServerTest); |
| 29 }); | 28 }); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 default: | 78 default: |
| 80 if (!notificationTypesReceived.add(notificationType)) { | 79 if (!notificationTypesReceived.add(notificationType)) { |
| 81 fail('Notification type $notificationType received more than once'); | 80 fail('Notification type $notificationType received more than once'); |
| 82 } | 81 } |
| 83 break; | 82 break; |
| 84 } | 83 } |
| 85 } | 84 } |
| 86 } | 85 } |
| 87 | 86 |
| 88 void processRequiredPlugins() { | 87 void processRequiredPlugins() { |
| 89 List<Plugin> plugins = <Plugin>[]; | |
| 90 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | |
| 91 | |
| 92 ExtensionManager manager = new ExtensionManager(); | 88 ExtensionManager manager = new ExtensionManager(); |
| 93 manager.processPlugins(plugins); | 89 manager.processPlugins(AnalysisEngine.instance.requiredPlugins); |
| 94 } | 90 } |
| 95 | 91 |
| 96 void setUp() { | 92 void setUp() { |
| 97 processRequiredPlugins(); | 93 processRequiredPlugins(); |
| 98 channel = new MockServerChannel(); | 94 channel = new MockServerChannel(); |
| 99 resourceProvider = new MemoryResourceProvider(); | 95 resourceProvider = new MemoryResourceProvider(); |
| 100 // Create an SDK in the mock file system. | 96 // Create an SDK in the mock file system. |
| 101 new MockSdk(resourceProvider: resourceProvider); | 97 new MockSdk(resourceProvider: resourceProvider); |
| 102 packageMapProvider = new MockPackageMapProvider(); | 98 packageMapProvider = new MockPackageMapProvider(); |
| 103 server = new AnalysisServer( | 99 server = new AnalysisServer( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 201 |
| 206 class EchoHandler implements RequestHandler { | 202 class EchoHandler implements RequestHandler { |
| 207 @override | 203 @override |
| 208 Response handleRequest(Request request) { | 204 Response handleRequest(Request request) { |
| 209 if (request.method == 'echo') { | 205 if (request.method == 'echo') { |
| 210 return new Response(request.id, result: {'echo': true}); | 206 return new Response(request.id, result: {'echo': true}); |
| 211 } | 207 } |
| 212 return null; | 208 return null; |
| 213 } | 209 } |
| 214 } | 210 } |
| OLD | NEW |