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