THRIFT-3702 Fix cross tests for Dart compact protocol (3 failing)

Client: Dart
Patch: Mark Erickson

This closes #917
This commit is contained in:
Mark Erickson 2016-03-01 16:53:35 -06:00
parent b5f126f6d6
commit 56c1c645f2
3 changed files with 12 additions and 6 deletions

View File

@ -20,7 +20,8 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:args/args.dart'; import 'package:args/args.dart';
import 'package:collection/equality.dart'; import 'package:collection/collection.dart';
import 'package:http/http.dart' as http;
import 'package:thrift/thrift.dart'; import 'package:thrift/thrift.dart';
import 'package:thrift/thrift_console.dart'; import 'package:thrift/thrift_console.dart';
import 'package:thrift_test/thrift_test.dart'; import 'package:thrift_test/thrift_test.dart';
@ -151,8 +152,9 @@ Future _initTestClient(
var protocolFactory = getProtocolFactory(protocolType); var protocolFactory = getProtocolFactory(protocolType);
if (transportType == 'http') { if (transportType == 'http') {
var httpClient = new HttpClient(); var httpClient = new http.IOClient();
var config = new THttpConfig(Uri.parse('http://localhost'), {}); var uri = Uri.parse('http://$host:$port');
var config = new THttpConfig(uri, {});
transport = new THttpClientTransport(httpClient, config); transport = new THttpClientTransport(httpClient, config);
} else { } else {
var socket = await Socket.connect(host, port); var socket = await Socket.connect(host, port);
@ -309,7 +311,7 @@ List<TTest> _createTests() {
tests.add(new TTest(TEST_EXCEPTIONS, 'testException', () async { tests.add(new TTest(TEST_EXCEPTIONS, 'testException', () async {
try { try {
await client.testException('Xception'); await client.testException('Xception');
} on Xception catch (x) { } on Xception catch (_) {
return; return;
} }
@ -319,7 +321,7 @@ List<TTest> _createTests() {
tests.add(new TTest(TEST_EXCEPTIONS, 'testMultiException', () async { tests.add(new TTest(TEST_EXCEPTIONS, 'testMultiException', () async {
try { try {
await client.testMultiException('Xception2', 'foo'); await client.testMultiException('Xception2', 'foo');
} on Xception2 catch (x) { } on Xception2 catch (_) {
return; return;
} }

View File

@ -24,6 +24,7 @@ environment:
sdk: ^1.12.0 sdk: ^1.12.0
dependencies: dependencies:
args: ^0.13.0 args: ^0.13.0
http: ^0.11.0
thrift: thrift:
path: ../../../lib/dart path: ../../../lib/dart
thrift_test: thrift_test:

View File

@ -19,6 +19,7 @@
"cpp-cpp_json_http-ip", "cpp-cpp_json_http-ip",
"cpp-cpp_json_http-ip-ssl", "cpp-cpp_json_http-ip-ssl",
"cpp-dart_binary_http-ip", "cpp-dart_binary_http-ip",
"cpp-dart_compact_http-ip",
"cpp-dart_json_http-ip", "cpp-dart_json_http-ip",
"cpp-go_binary_http-ip", "cpp-go_binary_http-ip",
"cpp-go_binary_http-ip-ssl", "cpp-go_binary_http-ip-ssl",
@ -101,8 +102,8 @@
"go-cpp_json_http-ip-ssl", "go-cpp_json_http-ip-ssl",
"go-dart_binary_framed-ip", "go-dart_binary_framed-ip",
"go-dart_binary_http-ip", "go-dart_binary_http-ip",
"go-dart_compact_http-ip",
"go-dart_json_framed-ip", "go-dart_json_framed-ip",
"go-nodejs_json_framed-ip",
"go-dart_json_http-ip", "go-dart_json_http-ip",
"go-java_binary_http-ip", "go-java_binary_http-ip",
"go-java_binary_http-ip-ssl", "go-java_binary_http-ip-ssl",
@ -110,12 +111,14 @@
"go-java_compact_http-ip-ssl", "go-java_compact_http-ip-ssl",
"go-java_json_http-ip", "go-java_json_http-ip",
"go-java_json_http-ip-ssl", "go-java_json_http-ip-ssl",
"go-nodejs_json_framed-ip",
"go-perl_binary_buffered-ip-ssl", "go-perl_binary_buffered-ip-ssl",
"go-perl_binary_framed-ip-ssl", "go-perl_binary_framed-ip-ssl",
"hs-csharp_binary_framed-ip", "hs-csharp_binary_framed-ip",
"hs-csharp_compact_framed-ip", "hs-csharp_compact_framed-ip",
"hs-csharp_json_framed-ip", "hs-csharp_json_framed-ip",
"hs-dart_binary_framed-ip", "hs-dart_binary_framed-ip",
"hs-dart_compact_framed-ip",
"hs-dart_json_framed-ip", "hs-dart_json_framed-ip",
"hs-py3_json_buffered-ip", "hs-py3_json_buffered-ip",
"hs-py3_json_framed-ip", "hs-py3_json_framed-ip",