THRIFT-2497 server and client for test/go, also several fixes and improvements
Client: Go
Patch: Aleksey Pesternikov
This closes #109
commit f2e7186ca8d63f407dba0c56ee51afd6405926ba
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-22T12:48:14Z
add _ to generated filename if it ends with _test.go
commit a6ed88196fbf4622a3b0261bbac0fe6b258bdd36
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-22T14:19:13Z
use tcxx instead of tr1 in test/cpp
commit d1848fa05f4baefc66eb405f4b1a8657bb2869bd
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-23T01:01:03Z
Merge branch 'master' of https://github.com/apache/thrift into go_integration
commit 04d22fef228d3f868b32a296a38f99ff52ee2142
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T00:34:24Z
additions:
test for client/server with several protocol/transport/ssl combinations
bin/testclient and bin/testserver
debug_transport
fixes:
separate Listen() and AcceptLoop() instead of Serve() in SimpleServer
if handler function returns any unknown exception, handler closes connection
commit ed88d57d977cffea9fac8f61143801f3097ef46c
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T13:29:54Z
Generate lowercase package name
lowercased pkg name in thrift files
underline() -> lowercase()
commit 498a910c6c6753a4b1e3633eb5c9c82be33e8c7b
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T13:32:26Z
Merge branch 'master' into go_test_service_name
commit 25792d7218a2c32ee3c2077f65ca7d0cea7f31f5
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-22T12:48:14Z
add _ to generated filename if it ends with _test.go
commit af994b415308a2e174d57a03675fc83d7cbd43d1
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T00:34:24Z
additions:
test for client/server with several protocol/transport/ssl combinations
bin/testclient and bin/testserver
debug_transport
fixes:
separate Listen() and AcceptLoop() instead of Serve() in SimpleServer
if handler function returns any unknown exception, handler closes connection
commit f22a777a5d5b4d93a8d7981e7aadc2c63919518a
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T13:44:08Z
Merge branch 'go_integration' of github.com:apesternikov/thrift into go_integration
commit 49a33c8c80ea35f923ee9aa3577780fcf41fe840
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T13:49:05Z
Merge branch 'master' into test_cpp_on_mac
commit 81b402ec6301f6b132c9b346ad5481f55f0aff89
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T13:56:56Z
operator < for ThriftTest
commit cde312d940d12077274dd0ba677ca850b5b439a7
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T14:12:58Z
minor formatting
commit 0a693115c2c20a2a8375f3859ff7bed261e6c8da
Author: Aleksey Pesternikov <ap@alekseys-mbp.att.net>
Date: 2014-04-25T14:13:20Z
Merge branch 'test_cpp_on_mac' into go_integration
commit e06b5d24e8b6d429723a3c77a58c6ce903e1366a
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T15:19:20Z
Merge branch 'go_test_service_name' into go_integration
commit 42d577c9812a070060c773fcd0598e58e6d6ba61
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T15:39:57Z
imported THRIFT-2491
lowercase package names
commit 491ccf8b018c046c5ced72b1e19d9ac4ec48a6f5
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T15:51:53Z
--noinsane flag for c++ TestClient. works with go server now for other default params
commit 78db3c9a3a5742818a5de6e57f2fe9aed84919e5
Author: Aleksey Pesternikov <ap@alekseys-macbook-pro.local>
Date: 2014-04-25T16:03:23Z
license
diff --git a/test/go/src/common/mock_handler.go b/test/go/src/common/mock_handler.go
new file mode 100644
index 0000000..0aed38b
--- /dev/null
+++ b/test/go/src/common/mock_handler.go
@@ -0,0 +1,266 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Automatically generated by MockGen. DO NOT EDIT!
+// Source: gen/thrifttest (interfaces: ThriftTest)
+
+package common
+
+import (
+ thrifttest "gen/thrifttest"
+ gomock "code.google.com/p/gomock/gomock"
+)
+
+// Mock of ThriftTest interface
+type MockThriftTest struct {
+ ctrl *gomock.Controller
+ recorder *_MockThriftTestRecorder
+}
+
+// Recorder for MockThriftTest (not exported)
+type _MockThriftTestRecorder struct {
+ mock *MockThriftTest
+}
+
+func NewMockThriftTest(ctrl *gomock.Controller) *MockThriftTest {
+ mock := &MockThriftTest{ctrl: ctrl}
+ mock.recorder = &_MockThriftTestRecorder{mock}
+ return mock
+}
+
+func (_m *MockThriftTest) EXPECT() *_MockThriftTestRecorder {
+ return _m.recorder
+}
+
+func (_m *MockThriftTest) TestByte(_param0 int8) (int8, error) {
+ ret := _m.ctrl.Call(_m, "TestByte", _param0)
+ ret0, _ := ret[0].(int8)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestByte(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestByte", arg0)
+}
+
+func (_m *MockThriftTest) TestDouble(_param0 float64) (float64, error) {
+ ret := _m.ctrl.Call(_m, "TestDouble", _param0)
+ ret0, _ := ret[0].(float64)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestDouble(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestDouble", arg0)
+}
+
+func (_m *MockThriftTest) TestEnum(_param0 thrifttest.Numberz) (thrifttest.Numberz, error) {
+ ret := _m.ctrl.Call(_m, "TestEnum", _param0)
+ ret0, _ := ret[0].(thrifttest.Numberz)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestEnum(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestEnum", arg0)
+}
+
+func (_m *MockThriftTest) TestException(_param0 string) error {
+ ret := _m.ctrl.Call(_m, "TestException", _param0)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+func (_mr *_MockThriftTestRecorder) TestException(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestException", arg0)
+}
+
+func (_m *MockThriftTest) TestI32(_param0 int32) (int32, error) {
+ ret := _m.ctrl.Call(_m, "TestI32", _param0)
+ ret0, _ := ret[0].(int32)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestI32(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI32", arg0)
+}
+
+func (_m *MockThriftTest) TestI64(_param0 int64) (int64, error) {
+ ret := _m.ctrl.Call(_m, "TestI64", _param0)
+ ret0, _ := ret[0].(int64)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestI64(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI64", arg0)
+}
+
+func (_m *MockThriftTest) TestInsanity(_param0 *thrifttest.Insanity) (map[thrifttest.UserId]map[thrifttest.Numberz]*thrifttest.Insanity, error) {
+ ret := _m.ctrl.Call(_m, "TestInsanity", _param0)
+ ret0, _ := ret[0].(map[thrifttest.UserId]map[thrifttest.Numberz]*thrifttest.Insanity)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestInsanity(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestInsanity", arg0)
+}
+
+func (_m *MockThriftTest) TestList(_param0 []int32) ([]int32, error) {
+ ret := _m.ctrl.Call(_m, "TestList", _param0)
+ ret0, _ := ret[0].([]int32)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestList(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestList", arg0)
+}
+
+func (_m *MockThriftTest) TestMap(_param0 map[int32]int32) (map[int32]int32, error) {
+ ret := _m.ctrl.Call(_m, "TestMap", _param0)
+ ret0, _ := ret[0].(map[int32]int32)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestMap(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMap", arg0)
+}
+
+func (_m *MockThriftTest) TestMapMap(_param0 int32) (map[int32]map[int32]int32, error) {
+ ret := _m.ctrl.Call(_m, "TestMapMap", _param0)
+ ret0, _ := ret[0].(map[int32]map[int32]int32)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestMapMap(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMapMap", arg0)
+}
+
+func (_m *MockThriftTest) TestMulti(_param0 int8, _param1 int32, _param2 int64, _param3 map[int16]string, _param4 thrifttest.Numberz, _param5 thrifttest.UserId) (*thrifttest.Xtruct, error) {
+ ret := _m.ctrl.Call(_m, "TestMulti", _param0, _param1, _param2, _param3, _param4, _param5)
+ ret0, _ := ret[0].(*thrifttest.Xtruct)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestMulti(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMulti", arg0, arg1, arg2, arg3, arg4, arg5)
+}
+
+func (_m *MockThriftTest) TestMultiException(_param0 string, _param1 string) (*thrifttest.Xtruct, error) {
+ ret := _m.ctrl.Call(_m, "TestMultiException", _param0, _param1)
+ ret0, _ := ret[0].(*thrifttest.Xtruct)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestMultiException(arg0, arg1 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMultiException", arg0, arg1)
+}
+
+func (_m *MockThriftTest) TestNest(_param0 *thrifttest.Xtruct2) (*thrifttest.Xtruct2, error) {
+ ret := _m.ctrl.Call(_m, "TestNest", _param0)
+ ret0, _ := ret[0].(*thrifttest.Xtruct2)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestNest(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestNest", arg0)
+}
+
+func (_m *MockThriftTest) TestOneway(_param0 int32) error {
+ ret := _m.ctrl.Call(_m, "TestOneway", _param0)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+func (_mr *_MockThriftTestRecorder) TestOneway(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestOneway", arg0)
+}
+
+func (_m *MockThriftTest) TestSet(_param0 map[int32]bool) (map[int32]bool, error) {
+ ret := _m.ctrl.Call(_m, "TestSet", _param0)
+ ret0, _ := ret[0].(map[int32]bool)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestSet(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestSet", arg0)
+}
+
+func (_m *MockThriftTest) TestString(_param0 string) (string, error) {
+ ret := _m.ctrl.Call(_m, "TestString", _param0)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestString(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestString", arg0)
+}
+
+func (_m *MockThriftTest) TestStringMap(_param0 map[string]string) (map[string]string, error) {
+ ret := _m.ctrl.Call(_m, "TestStringMap", _param0)
+ ret0, _ := ret[0].(map[string]string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestStringMap(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStringMap", arg0)
+}
+
+func (_m *MockThriftTest) TestStruct(_param0 *thrifttest.Xtruct) (*thrifttest.Xtruct, error) {
+ ret := _m.ctrl.Call(_m, "TestStruct", _param0)
+ ret0, _ := ret[0].(*thrifttest.Xtruct)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestStruct(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStruct", arg0)
+}
+
+func (_m *MockThriftTest) TestTypedef(_param0 thrifttest.UserId) (thrifttest.UserId, error) {
+ ret := _m.ctrl.Call(_m, "TestTypedef", _param0)
+ ret0, _ := ret[0].(thrifttest.UserId)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestTypedef(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestTypedef", arg0)
+}
+
+func (_m *MockThriftTest) TestVoid() error {
+ ret := _m.ctrl.Call(_m, "TestVoid")
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+func (_mr *_MockThriftTestRecorder) TestVoid() *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestVoid")
+}