Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: pkg/analysis_server/test/protocol_test.dart

Issue 2394683006: Switch analysis_server to use 'package:test'. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_reflective_loader/test_reflective_loader.dart'; 13 import 'package:test_reflective_loader/test_reflective_loader.dart';
13 import 'package:unittest/unittest.dart';
14 14
15 import 'utils.dart'; 15 import 'utils.dart';
16 16
17 main() { 17 main() {
18 initializeTestEnvironment(); 18 initializeTestEnvironment();
19 defineReflectiveTests(NotificationTest); 19 defineReflectiveSuite(() {
20 defineReflectiveTests(RequestTest); 20 defineReflectiveTests(NotificationTest);
21 defineReflectiveTests(RequestErrorTest); 21 defineReflectiveTests(RequestTest);
22 defineReflectiveTests(ResponseTest); 22 defineReflectiveTests(RequestErrorTest);
23 defineReflectiveTests(ResponseTest);
24 });
23 } 25 }
24 26
25 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>()); 27 Matcher _throwsRequestFailure = throwsA(new isInstanceOf<RequestFailure>());
26 28
27 @reflectiveTest 29 @reflectiveTest
28 class InvalidParameterResponseMatcher extends Matcher { 30 class InvalidParameterResponseMatcher extends Matcher {
29 static const String ERROR_CODE = 'INVALID_PARAMETER'; 31 static const String ERROR_CODE = 'INVALID_PARAMETER';
30 32
31 @override 33 @override
32 Description describe(Description description) => 34 Description describe(Description description) =>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void test_fromJson_withResult() { 267 void test_fromJson_withResult() {
266 Response original = new Response('myId', result: {'foo': 'bar'}); 268 Response original = new Response('myId', result: {'foo': 'bar'});
267 Response response = new Response.fromJson(original.toJson()); 269 Response response = new Response.fromJson(original.toJson());
268 expect(response.id, equals('myId')); 270 expect(response.id, equals('myId'));
269 Map<String, Object> result = 271 Map<String, Object> result =
270 response.toJson()['result'] as Map<String, Object>; 272 response.toJson()['result'] as Map<String, Object>;
271 expect(result.length, equals(1)); 273 expect(result.length, equals(1));
272 expect(result['foo'], equals('bar')); 274 expect(result['foo'], equals('bar'));
273 } 275 }
274 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698