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 19 matching lines...) Expand all Loading... |
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 serverPlugin, | 38 serverPlugin, |
39 new AnalysisServerOptions(), | 39 new AnalysisServerOptions(), |
40 new MockSdk(), | 40 () => new MockSdk(), |
41 InstrumentationService.NULL_SERVICE); | 41 InstrumentationService.NULL_SERVICE); |
42 handler = new ServerDomainHandler(server); | 42 handler = new ServerDomainHandler(server); |
43 }); | 43 }); |
44 | 44 |
45 group('ServerDomainHandler', () { | 45 group('ServerDomainHandler', () { |
46 test('getVersion', () { | 46 test('getVersion', () { |
47 var request = new ServerGetVersionParams().toRequest('0'); | 47 var request = new ServerGetVersionParams().toRequest('0'); |
48 var response = handler.handleRequest(request); | 48 var response = handler.handleRequest(request); |
49 expect( | 49 expect( |
50 response.toJson(), | 50 response.toJson(), |
(...skipping 29 matching lines...) Expand all Loading... |
80 expect(server.running, isTrue); | 80 expect(server.running, isTrue); |
81 // send request | 81 // send request |
82 var request = new ServerShutdownParams().toRequest('0'); | 82 var request = new ServerShutdownParams().toRequest('0'); |
83 var response = handler.handleRequest(request); | 83 var response = handler.handleRequest(request); |
84 expect(response, isResponseSuccess('0')); | 84 expect(response, isResponseSuccess('0')); |
85 // server is down | 85 // server is down |
86 expect(server.running, isFalse); | 86 expect(server.running, isFalse); |
87 }); | 87 }); |
88 }); | 88 }); |
89 } | 89 } |
OLD | NEW |