| 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.analysis_server; | 5 library test.analysis_server; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
| 8 import 'package:analysis_server/src/constants.dart'; | 8 import 'package:analysis_server/src/constants.dart'; |
| 9 import 'package:analysis_server/src/domain_server.dart'; | 9 import 'package:analysis_server/src/domain_server.dart'; |
| 10 import 'package:analysis_server/src/operation/operation.dart'; | 10 import 'package:analysis_server/src/operation/operation.dart'; |
| 11 import 'package:analysis_server/src/protocol.dart'; | 11 import 'package:analysis_server/src/protocol.dart'; |
| 12 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 13 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 13 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
| 14 import 'package:analyzer/src/generated/java_engine.dart'; | 15 import 'package:analyzer/src/generated/java_engine.dart'; |
| 15 import 'package:analyzer/src/generated/source.dart'; | 16 import 'package:analyzer/src/generated/source.dart'; |
| 16 import 'package:typed_mock/typed_mock.dart'; | 17 import 'package:typed_mock/typed_mock.dart'; |
| 17 import 'package:unittest/unittest.dart'; | 18 import 'package:unittest/unittest.dart'; |
| 18 | 19 |
| 19 import 'mock_sdk.dart'; | 20 import 'mock_sdk.dart'; |
| 20 import 'mocks.dart'; | 21 import 'mocks.dart'; |
| 21 | 22 |
| 22 main() { | 23 main() { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 AnalysisServerTestHelper({bool rethrowExceptions: true}) { | 201 AnalysisServerTestHelper({bool rethrowExceptions: true}) { |
| 201 channel = new MockServerChannel(); | 202 channel = new MockServerChannel(); |
| 202 resourceProvider = new MemoryResourceProvider(); | 203 resourceProvider = new MemoryResourceProvider(); |
| 203 server = new AnalysisServer( | 204 server = new AnalysisServer( |
| 204 channel, | 205 channel, |
| 205 resourceProvider, | 206 resourceProvider, |
| 206 new MockPackageMapProvider(), | 207 new MockPackageMapProvider(), |
| 207 null, | 208 null, |
| 208 new AnalysisServerOptions(), | 209 new AnalysisServerOptions(), |
| 209 new MockSdk(), | 210 new MockSdk(), |
| 211 new NullInstrumentationServer(), |
| 210 rethrowExceptions: rethrowExceptions); | 212 rethrowExceptions: rethrowExceptions); |
| 211 } | 213 } |
| 212 } | 214 } |
| 213 | 215 |
| 214 class EchoHandler implements RequestHandler { | 216 class EchoHandler implements RequestHandler { |
| 215 @override | 217 @override |
| 216 Response handleRequest(Request request) { | 218 Response handleRequest(Request request) { |
| 217 if (request.method == 'echo') { | 219 if (request.method == 'echo') { |
| 218 return new Response(request.id, result: { | 220 return new Response(request.id, result: { |
| 219 'echo': true | 221 'echo': true |
| 220 }); | 222 }); |
| 221 } | 223 } |
| 222 return null; | 224 return null; |
| 223 } | 225 } |
| 224 } | 226 } |
| OLD | NEW |