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

Unified Diff: pkg/json_rpc_2/test/server/invalid_request_test.dart

Issue 309503005: Convert json_rpc.Server to take a Stream and StreamSink. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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/json_rpc_2/test/server/batch_test.dart ('k') | pkg/json_rpc_2/test/server/server_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json_rpc_2/test/server/invalid_request_test.dart
diff --git a/pkg/json_rpc_2/test/server/invalid_request_test.dart b/pkg/json_rpc_2/test/server/invalid_request_test.dart
index feeefea9c4c544b4c765119bdf1c58113a2a2548..74cf86fec3b67304c7dc9bd298294fcda8fc6940 100644
--- a/pkg/json_rpc_2/test/server/invalid_request_test.dart
+++ b/pkg/json_rpc_2/test/server/invalid_request_test.dart
@@ -13,23 +13,23 @@ import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
import 'utils.dart';
void main() {
- var server;
- setUp(() => server = new json_rpc.Server());
+ var controller;
+ setUp(() => controller = new ServerController());
test("a non-Array/Object request is invalid", () {
- expectErrorResponse(server, 'foo', error_code.INVALID_REQUEST,
+ expectErrorResponse(controller, 'foo', error_code.INVALID_REQUEST,
'Request must be an Array or an Object.');
});
test("requests must have a jsonrpc key", () {
- expectErrorResponse(server, {
+ expectErrorResponse(controller, {
'method': 'foo',
'id': 1234
}, error_code.INVALID_REQUEST, 'Request must contain a "jsonrpc" key.');
});
test("the jsonrpc version must be 2.0", () {
- expectErrorResponse(server, {
+ expectErrorResponse(controller, {
'jsonrpc': '1.0',
'method': 'foo',
'id': 1234
@@ -38,14 +38,14 @@ void main() {
});
test("requests must have a method key", () {
- expectErrorResponse(server, {
+ expectErrorResponse(controller, {
'jsonrpc': '2.0',
'id': 1234
}, error_code.INVALID_REQUEST, 'Request must contain a "method" key.');
});
test("request method must be a string", () {
- expectErrorResponse(server, {
+ expectErrorResponse(controller, {
'jsonrpc': '2.0',
'method': 1234,
'id': 1234
@@ -54,7 +54,7 @@ void main() {
});
test("request params must be an Array or Object", () {
- expectErrorResponse(server, {
+ expectErrorResponse(controller, {
'jsonrpc': '2.0',
'method': 'foo',
'params': 1234,
@@ -64,7 +64,7 @@ void main() {
});
test("request id may not be an Array or Object", () {
- expect(server.handleRequest({
+ expect(controller.handleRequest({
'jsonrpc': '2.0',
'method': 'foo',
'id': {'bad': 'id'}
« no previous file with comments | « pkg/json_rpc_2/test/server/batch_test.dart ('k') | pkg/json_rpc_2/test/server/server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698