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

Unified Diff: pkg/analysis_server/test/protocol_test.dart

Issue 530583004: Rename Error to RequestError in analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/integration/protocol_matchers.dart ('k') | pkg/analysis_server/tool/spec/api.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/protocol_test.dart
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index c31f4930d888871e52e6e7013bfe3d107ab78c21..e321f63fd9431c0e1b5f531a24ddeb5e9c106354 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -6,6 +6,7 @@ library test.protocol;
import 'dart:convert';
+import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_testing/reflective_tests.dart';
import 'package:unittest/unittest.dart';
@@ -98,40 +99,35 @@ class RequestErrorTest {
expect(error.code, RequestErrorCode.INVALID_REQUEST);
expect(error.message, "msg");
expect(error.toJson(), equals({
- RequestError.CODE: 'INVALID_REQUEST',
- RequestError.MESSAGE: "msg"
+ CODE: 'INVALID_REQUEST',
+ MESSAGE: "msg"
}));
}
- void test_create_serverAlreadyStarted() {
- RequestError error = new RequestError.serverAlreadyStarted();
- expect(error.code, RequestErrorCode.SERVER_ALREADY_STARTED);
- expect(error.message, "Server already started");
- }
-
void test_fromJson() {
var json = {
- RequestError.CODE: RequestErrorCode.INVALID_PARAMETER.name,
- RequestError.MESSAGE: 'foo',
- RequestError.DATA: {
+ CODE: RequestErrorCode.INVALID_PARAMETER.name,
+ MESSAGE: 'foo',
+ DATA: {
'ints': [1, 2, 3]
}
};
- RequestError error = new RequestError.fromJson(json);
+ RequestError error = new RequestError.fromJson(new ResponseDecoder(), '',
+ json);
expect(error.code, RequestErrorCode.INVALID_PARAMETER);
expect(error.message, "foo");
expect(error.data['ints'], [1, 2, 3]);
- expect(error.getData('ints'), [1, 2, 3]);
}
void test_toJson() {
- RequestError error = new RequestError(RequestErrorCode.UNKNOWN_REQUEST, 'msg');
- error.setData('answer', 42);
- error.setData('question', 'unknown');
+ RequestError error = new RequestError(
+ RequestErrorCode.UNKNOWN_REQUEST, 'msg', data: {});
+ error.data['answer'] = 42;
+ error.data['question'] = 'unknown';
expect(error.toJson(), {
- RequestError.CODE: 'UNKNOWN_REQUEST',
- RequestError.MESSAGE: 'msg',
- RequestError.DATA: {
+ CODE: 'UNKNOWN_REQUEST',
+ MESSAGE: 'msg',
+ DATA: {
'answer': 42,
'question': 'unknown'
}
« no previous file with comments | « pkg/analysis_server/test/integration/protocol_matchers.dart ('k') | pkg/analysis_server/tool/spec/api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698