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.domain.server; | 5 library test.domain.server; |
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/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
10 import 'package:analysis_server/src/domain_server.dart'; | 10 import 'package:analysis_server/src/domain_server.dart'; |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 setUp(() { | 28 setUp(() { |
29 var serverChannel = new MockServerChannel(); | 29 var serverChannel = new MockServerChannel(); |
30 var resourceProvider = new MemoryResourceProvider(); | 30 var resourceProvider = new MemoryResourceProvider(); |
31 ExtensionManager manager = new ExtensionManager(); | 31 ExtensionManager manager = new ExtensionManager(); |
32 ServerPlugin serverPlugin = new ServerPlugin(); | 32 ServerPlugin serverPlugin = new ServerPlugin(); |
33 manager.processPlugins([serverPlugin]); | 33 manager.processPlugins([serverPlugin]); |
34 server = new AnalysisServer( | 34 server = new AnalysisServer( |
35 serverChannel, | 35 serverChannel, |
36 resourceProvider, | 36 resourceProvider, |
| 37 new MockPackageMapProvider(), |
37 null, | 38 null, |
38 serverPlugin, | 39 serverPlugin, |
39 new AnalysisServerOptions(), | 40 new AnalysisServerOptions(), |
40 new DartSdkManager('', false, (_) => new MockSdk()), | 41 new DartSdkManager('', false, (_) => new MockSdk()), |
41 InstrumentationService.NULL_SERVICE); | 42 InstrumentationService.NULL_SERVICE); |
42 handler = new ServerDomainHandler(server); | 43 handler = new ServerDomainHandler(server); |
43 }); | 44 }); |
44 | 45 |
45 group('ServerDomainHandler', () { | 46 group('ServerDomainHandler', () { |
46 test('getVersion', () { | 47 test('getVersion', () { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 expect(server.running, isTrue); | 81 expect(server.running, isTrue); |
81 // send request | 82 // send request |
82 var request = new ServerShutdownParams().toRequest('0'); | 83 var request = new ServerShutdownParams().toRequest('0'); |
83 var response = handler.handleRequest(request); | 84 var response = handler.handleRequest(request); |
84 expect(response, isResponseSuccess('0')); | 85 expect(response, isResponseSuccess('0')); |
85 // server is down | 86 // server is down |
86 expect(server.running, isFalse); | 87 expect(server.running, isFalse); |
87 }); | 88 }); |
88 }); | 89 }); |
89 } | 90 } |
OLD | NEW |