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.protocol; | 5 library test.protocol; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
11 import 'package:analysis_server/src/protocol/protocol_internal.dart'; | 11 import 'package:analysis_server/src/protocol/protocol_internal.dart'; |
12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 | 14 |
15 import 'utils.dart'; | |
16 | |
17 main() { | 15 main() { |
18 initializeTestEnvironment(); | |
19 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
20 defineReflectiveTests(NotificationTest); | 17 defineReflectiveTests(NotificationTest); |
21 defineReflectiveTests(RequestTest); | 18 defineReflectiveTests(RequestTest); |
22 defineReflectiveTests(RequestErrorTest); | 19 defineReflectiveTests(RequestErrorTest); |
23 defineReflectiveTests(ResponseTest); | 20 defineReflectiveTests(ResponseTest); |
24 }); | 21 }); |
25 } | 22 } |
26 | 23 |
27 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>()); | 24 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>()); |
28 | 25 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void test_fromJson_withResult() { | 264 void test_fromJson_withResult() { |
268 Response original = new Response('myId', result: {'foo': 'bar'}); | 265 Response original = new Response('myId', result: {'foo': 'bar'}); |
269 Response response = new Response.fromJson(original.toJson()); | 266 Response response = new Response.fromJson(original.toJson()); |
270 expect(response.id, equals('myId')); | 267 expect(response.id, equals('myId')); |
271 Map<String, Object> result = | 268 Map<String, Object> result = |
272 response.toJson()['result'] as Map<String, Object>; | 269 response.toJson()['result'] as Map<String, Object>; |
273 expect(result.length, equals(1)); | 270 expect(result.length, equals(1)); |
274 expect(result['foo'], equals('bar')); | 271 expect(result['foo'], equals('bar')); |
275 } | 272 } |
276 } | 273 } |
OLD | NEW |