Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | |
| 20 | package common |
| 21 | |
| 22 | import ( |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 23 | "errors" |
| 24 | "gen/thrifttest" |
| 25 | "reflect" |
| 26 | "testing" |
| 27 | "thrift" |
claudemiro | f8ca055 | 2016-01-10 23:31:30 -0200 | [diff] [blame] | 28 | |
| 29 | "github.com/golang/mock/gomock" |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 30 | ) |
| 31 | |
| 32 | type test_unit struct { |
| 33 | host string |
| 34 | port int64 |
| 35 | domain_socket string |
| 36 | transport string |
| 37 | protocol string |
| 38 | ssl bool |
| 39 | } |
| 40 | |
| 41 | var units = []test_unit{ |
Nobuaki Sukegawa | fd02a30 | 2016-08-16 14:06:48 +0900 | [diff] [blame] | 42 | {"127.0.0.1", 9095, "", "", "binary", false}, |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 43 | {"127.0.0.1", 9091, "", "", "compact", false}, |
| 44 | {"127.0.0.1", 9092, "", "", "binary", true}, |
| 45 | {"127.0.0.1", 9093, "", "", "compact", true}, |
| 46 | } |
| 47 | |
| 48 | func TestAllConnection(t *testing.T) { |
| 49 | certPath = "../../../keys" |
| 50 | for _, unit := range units { |
| 51 | t.Logf("%#v", unit) |
| 52 | doUnit(t, &unit) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func doUnit(t *testing.T, unit *test_unit) { |
| 57 | ctrl := gomock.NewController(t) |
| 58 | defer ctrl.Finish() |
| 59 | handler := NewMockThriftTest(ctrl) |
claudemiro | f8ca055 | 2016-01-10 23:31:30 -0200 | [diff] [blame] | 60 | |
| 61 | processor, serverTransport, transportFactory, protocolFactory, err := GetServerParams(unit.host, unit.port, unit.domain_socket, unit.transport, unit.protocol, unit.ssl, "../../../keys", handler) |
| 62 | |
| 63 | server := thrift.NewTSimpleServer4(processor, serverTransport, transportFactory, protocolFactory) |
| 64 | if err = server.Listen(); err != nil { |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 65 | t.Errorf("Unable to start server", err) |
| 66 | t.FailNow() |
| 67 | } |
John Sirois | f7d4979 | 2016-02-03 17:12:19 -0700 | [diff] [blame] | 68 | go server.AcceptLoop() |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 69 | defer server.Stop() |
| 70 | client, err := StartClient(unit.host, unit.port, unit.domain_socket, unit.transport, unit.protocol, unit.ssl) |
| 71 | if err != nil { |
| 72 | t.Errorf("Unable to start client", err) |
| 73 | t.FailNow() |
| 74 | } |
| 75 | defer client.Transport.Close() |
| 76 | callEverythingWithMock(t, client, handler) |
| 77 | } |
| 78 | |
| 79 | var rmapmap = map[int32]map[int32]int32{ |
| 80 | -4: map[int32]int32{-4: -4, -3: -3, -2: -2, -1: -1}, |
| 81 | 4: map[int32]int32{4: 4, 3: 3, 2: 2, 1: 1}, |
| 82 | } |
| 83 | |
| 84 | var xxs = &thrifttest.Xtruct{ |
| 85 | StringThing: "Hello2", |
| 86 | ByteThing: 42, |
| 87 | I32Thing: 4242, |
| 88 | I64Thing: 424242, |
| 89 | } |
| 90 | |
| 91 | var xcept = &thrifttest.Xception{ErrorCode: 1001, Message: "some"} |
| 92 | |
| 93 | func callEverythingWithMock(t *testing.T, client *thrifttest.ThriftTestClient, handler *MockThriftTest) { |
| 94 | gomock.InOrder( |
taozle | c0d384a | 2017-07-17 18:40:42 +0200 | [diff] [blame] | 95 | handler.EXPECT().TestVoid(gomock.Any()), |
| 96 | handler.EXPECT().TestString(gomock.Any(), "thing").Return("thing", nil), |
| 97 | handler.EXPECT().TestBool(gomock.Any(), true).Return(true, nil), |
| 98 | handler.EXPECT().TestBool(gomock.Any(), false).Return(false, nil), |
| 99 | handler.EXPECT().TestByte(gomock.Any(), int8(42)).Return(int8(42), nil), |
| 100 | handler.EXPECT().TestI32(gomock.Any(), int32(4242)).Return(int32(4242), nil), |
| 101 | handler.EXPECT().TestI64(gomock.Any(), int64(424242)).Return(int64(424242), nil), |
Jens Geyer | 8bcfdd9 | 2014-12-14 03:14:26 +0100 | [diff] [blame] | 102 | // TODO: add TestBinary() |
taozle | c0d384a | 2017-07-17 18:40:42 +0200 | [diff] [blame] | 103 | handler.EXPECT().TestDouble(gomock.Any(), float64(42.42)).Return(float64(42.42), nil), |
| 104 | handler.EXPECT().TestStruct(gomock.Any(), &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}).Return(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}, nil), |
| 105 | handler.EXPECT().TestNest(gomock.Any(), &thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}).Return(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}, nil), |
| 106 | handler.EXPECT().TestMap(gomock.Any(), map[int32]int32{1: 2, 3: 4, 5: 42}).Return(map[int32]int32{1: 2, 3: 4, 5: 42}, nil), |
| 107 | handler.EXPECT().TestStringMap(gomock.Any(), map[string]string{"a": "2", "b": "blah", "some": "thing"}).Return(map[string]string{"a": "2", "b": "blah", "some": "thing"}, nil), |
| 108 | handler.EXPECT().TestSet(gomock.Any(), []int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil), |
| 109 | handler.EXPECT().TestList(gomock.Any(), []int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil), |
| 110 | handler.EXPECT().TestEnum(gomock.Any(), thrifttest.Numberz_TWO).Return(thrifttest.Numberz_TWO, nil), |
| 111 | handler.EXPECT().TestTypedef(gomock.Any(), thrifttest.UserId(42)).Return(thrifttest.UserId(42), nil), |
| 112 | handler.EXPECT().TestMapMap(gomock.Any(), int32(42)).Return(rmapmap, nil), |
Nobuaki Sukegawa | 2fab3de | 2015-08-16 15:42:58 +0900 | [diff] [blame] | 113 | // TODO: not testing insanity |
taozle | c0d384a | 2017-07-17 18:40:42 +0200 | [diff] [blame] | 114 | handler.EXPECT().TestMulti(gomock.Any(), int8(42), int32(4242), int64(424242), map[int16]string{1: "blah", 2: "thing"}, thrifttest.Numberz_EIGHT, thrifttest.UserId(24)).Return(xxs, nil), |
| 115 | handler.EXPECT().TestException(gomock.Any(), "some").Return(xcept), |
| 116 | handler.EXPECT().TestException(gomock.Any(), "TException").Return(errors.New("Just random exception")), |
| 117 | handler.EXPECT().TestMultiException(gomock.Any(), "Xception", "ignoreme").Return(nil, &thrifttest.Xception{ErrorCode: 1001, Message: "This is an Xception"}), |
| 118 | handler.EXPECT().TestMultiException(gomock.Any(), "Xception2", "ignoreme").Return(nil, &thrifttest.Xception2{ErrorCode: 2002, StructThing: &thrifttest.Xtruct{StringThing: "This is an Xception2"}}), |
| 119 | handler.EXPECT().TestOneway(gomock.Any(), int32(2)).Return(nil), |
| 120 | handler.EXPECT().TestVoid(gomock.Any()), |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 121 | ) |
| 122 | var err error |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 123 | if err = client.TestVoid(defaultCtx); err != nil { |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 124 | t.Errorf("Unexpected error in TestVoid() call: ", err) |
| 125 | } |
| 126 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 127 | thing, err := client.TestString(defaultCtx, "thing") |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 128 | if err != nil { |
| 129 | t.Errorf("Unexpected error in TestString() call: ", err) |
| 130 | } |
| 131 | if thing != "thing" { |
| 132 | t.Errorf("Unexpected TestString() result, expected 'thing' got '%s' ", thing) |
| 133 | } |
| 134 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 135 | bl, err := client.TestBool(defaultCtx, true) |
Nobuaki Sukegawa | a649e74 | 2015-09-21 13:53:25 +0900 | [diff] [blame] | 136 | if err != nil { |
| 137 | t.Errorf("Unexpected error in TestBool() call: ", err) |
| 138 | } |
| 139 | if !bl { |
| 140 | t.Errorf("Unexpected TestBool() result expected true, got %f ", bl) |
| 141 | } |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 142 | bl, err = client.TestBool(defaultCtx, false) |
Nobuaki Sukegawa | a649e74 | 2015-09-21 13:53:25 +0900 | [diff] [blame] | 143 | if err != nil { |
| 144 | t.Errorf("Unexpected error in TestBool() call: ", err) |
| 145 | } |
| 146 | if bl { |
| 147 | t.Errorf("Unexpected TestBool() result expected false, got %f ", bl) |
| 148 | } |
| 149 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 150 | b, err := client.TestByte(defaultCtx, 42) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 151 | if err != nil { |
| 152 | t.Errorf("Unexpected error in TestByte() call: ", err) |
| 153 | } |
| 154 | if b != 42 { |
| 155 | t.Errorf("Unexpected TestByte() result expected 42, got %d ", b) |
| 156 | } |
| 157 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 158 | i32, err := client.TestI32(defaultCtx, 4242) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 159 | if err != nil { |
| 160 | t.Errorf("Unexpected error in TestI32() call: ", err) |
| 161 | } |
| 162 | if i32 != 4242 { |
| 163 | t.Errorf("Unexpected TestI32() result expected 4242, got %d ", i32) |
| 164 | } |
| 165 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 166 | i64, err := client.TestI64(defaultCtx, 424242) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 167 | if err != nil { |
| 168 | t.Errorf("Unexpected error in TestI64() call: ", err) |
| 169 | } |
| 170 | if i64 != 424242 { |
| 171 | t.Errorf("Unexpected TestI64() result expected 424242, got %d ", i64) |
| 172 | } |
| 173 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 174 | d, err := client.TestDouble(defaultCtx, 42.42) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 175 | if err != nil { |
| 176 | t.Errorf("Unexpected error in TestDouble() call: ", err) |
| 177 | } |
| 178 | if d != 42.42 { |
| 179 | t.Errorf("Unexpected TestDouble() result expected 42.42, got %f ", d) |
| 180 | } |
| 181 | |
Jens Geyer | 8bcfdd9 | 2014-12-14 03:14:26 +0100 | [diff] [blame] | 182 | // TODO: add TestBinary() call |
claudemiro | f8ca055 | 2016-01-10 23:31:30 -0200 | [diff] [blame] | 183 | |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 184 | xs := thrifttest.NewXtruct() |
| 185 | xs.StringThing = "thing" |
| 186 | xs.ByteThing = 42 |
| 187 | xs.I32Thing = 4242 |
| 188 | xs.I64Thing = 424242 |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 189 | xsret, err := client.TestStruct(defaultCtx, xs) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 190 | if err != nil { |
| 191 | t.Errorf("Unexpected error in TestStruct() call: ", err) |
| 192 | } |
| 193 | if *xs != *xsret { |
| 194 | t.Errorf("Unexpected TestStruct() result expected %#v, got %#v ", xs, xsret) |
| 195 | } |
| 196 | |
| 197 | x2 := thrifttest.NewXtruct2() |
| 198 | x2.StructThing = xs |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 199 | x2ret, err := client.TestNest(defaultCtx, x2) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 200 | if err != nil { |
| 201 | t.Errorf("Unexpected error in TestNest() call: ", err) |
| 202 | } |
| 203 | if !reflect.DeepEqual(x2, x2ret) { |
| 204 | t.Errorf("Unexpected TestNest() result expected %#v, got %#v ", x2, x2ret) |
| 205 | } |
| 206 | |
| 207 | m := map[int32]int32{1: 2, 3: 4, 5: 42} |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 208 | mret, err := client.TestMap(defaultCtx, m) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 209 | if err != nil { |
| 210 | t.Errorf("Unexpected error in TestMap() call: ", err) |
| 211 | } |
| 212 | if !reflect.DeepEqual(m, mret) { |
| 213 | t.Errorf("Unexpected TestMap() result expected %#v, got %#v ", m, mret) |
| 214 | } |
| 215 | |
| 216 | sm := map[string]string{"a": "2", "b": "blah", "some": "thing"} |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 217 | smret, err := client.TestStringMap(defaultCtx, sm) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 218 | if err != nil { |
| 219 | t.Errorf("Unexpected error in TestStringMap() call: ", err) |
| 220 | } |
| 221 | if !reflect.DeepEqual(sm, smret) { |
| 222 | t.Errorf("Unexpected TestStringMap() result expected %#v, got %#v ", sm, smret) |
| 223 | } |
| 224 | |
D. Can Celasun | 43fb34d | 2017-01-15 10:53:19 +0100 | [diff] [blame] | 225 | s := []int32{1, 2, 42} |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 226 | sret, err := client.TestSet(defaultCtx, s) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 227 | if err != nil { |
| 228 | t.Errorf("Unexpected error in TestSet() call: ", err) |
| 229 | } |
D. Can Celasun | 43fb34d | 2017-01-15 10:53:19 +0100 | [diff] [blame] | 230 | // Sets can be in any order, but Go slices are ordered, so reflect.DeepEqual won't work. |
| 231 | stemp := map[int32]struct{}{} |
| 232 | for _, val := range s { |
| 233 | stemp[val] = struct{}{} |
| 234 | } |
| 235 | for _, val := range sret { |
| 236 | if _, ok := stemp[val]; !ok { |
| 237 | t.Fatalf("Unexpected TestSet() result expected %#v, got %#v ", s, sret) |
| 238 | } |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | l := []int32{1, 2, 42} |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 242 | lret, err := client.TestList(defaultCtx, l) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 243 | if err != nil { |
| 244 | t.Errorf("Unexpected error in TestList() call: ", err) |
| 245 | } |
| 246 | if !reflect.DeepEqual(l, lret) { |
D. Can Celasun | 43fb34d | 2017-01-15 10:53:19 +0100 | [diff] [blame] | 247 | t.Errorf("Unexpected TestList() result expected %#v, got %#v ", l, lret) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 248 | } |
| 249 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 250 | eret, err := client.TestEnum(defaultCtx, thrifttest.Numberz_TWO) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 251 | if err != nil { |
| 252 | t.Errorf("Unexpected error in TestEnum() call: ", err) |
| 253 | } |
| 254 | if eret != thrifttest.Numberz_TWO { |
| 255 | t.Errorf("Unexpected TestEnum() result expected %#v, got %#v ", thrifttest.Numberz_TWO, eret) |
| 256 | } |
| 257 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 258 | tret, err := client.TestTypedef(defaultCtx, thrifttest.UserId(42)) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 259 | if err != nil { |
| 260 | t.Errorf("Unexpected error in TestTypedef() call: ", err) |
| 261 | } |
| 262 | if tret != thrifttest.UserId(42) { |
| 263 | t.Errorf("Unexpected TestTypedef() result expected %#v, got %#v ", thrifttest.UserId(42), tret) |
| 264 | } |
| 265 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 266 | mapmap, err := client.TestMapMap(defaultCtx, 42) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 267 | if err != nil { |
| 268 | t.Errorf("Unexpected error in TestMapmap() call: ", err) |
| 269 | } |
| 270 | if !reflect.DeepEqual(mapmap, rmapmap) { |
| 271 | t.Errorf("Unexpected TestMapmap() result expected %#v, got %#v ", rmapmap, mapmap) |
| 272 | } |
| 273 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 274 | xxsret, err := client.TestMulti(defaultCtx, 42, 4242, 424242, map[int16]string{1: "blah", 2: "thing"}, thrifttest.Numberz_EIGHT, thrifttest.UserId(24)) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 275 | if err != nil { |
| 276 | t.Errorf("Unexpected error in TestMulti() call: ", err) |
| 277 | } |
| 278 | if !reflect.DeepEqual(xxs, xxsret) { |
| 279 | t.Errorf("Unexpected TestMulti() result expected %#v, got %#v ", xxs, xxsret) |
| 280 | } |
| 281 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 282 | err = client.TestException(defaultCtx, "some") |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 283 | if err == nil { |
| 284 | t.Errorf("Expecting exception in TestException() call") |
| 285 | } |
| 286 | if !reflect.DeepEqual(err, xcept) { |
| 287 | t.Errorf("Unexpected TestException() result expected %#v, got %#v ", xcept, err) |
| 288 | } |
| 289 | |
| 290 | // TODO: connection is being closed on this |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 291 | err = client.TestException(defaultCtx, "TException") |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 292 | tex, ok := err.(thrift.TApplicationException) |
| 293 | if err == nil || !ok || tex.TypeId() != thrift.INTERNAL_ERROR { |
| 294 | t.Errorf("Unexpected TestException() result expected ApplicationError, got %#v ", err) |
| 295 | } |
| 296 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 297 | ign, err := client.TestMultiException(defaultCtx, "Xception", "ignoreme") |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 298 | if ign != nil || err == nil { |
| 299 | t.Errorf("Expecting exception in TestMultiException() call") |
| 300 | } |
| 301 | if !reflect.DeepEqual(err, &thrifttest.Xception{ErrorCode: 1001, Message: "This is an Xception"}) { |
| 302 | t.Errorf("Unexpected TestMultiException() %#v ", err) |
| 303 | } |
| 304 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 305 | ign, err = client.TestMultiException(defaultCtx, "Xception2", "ignoreme") |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 306 | if ign != nil || err == nil { |
| 307 | t.Errorf("Expecting exception in TestMultiException() call") |
| 308 | } |
| 309 | expecting := &thrifttest.Xception2{ErrorCode: 2002, StructThing: &thrifttest.Xtruct{StringThing: "This is an Xception2"}} |
| 310 | |
| 311 | if !reflect.DeepEqual(err, expecting) { |
| 312 | t.Errorf("Unexpected TestMultiException() %#v ", err) |
| 313 | } |
| 314 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 315 | err = client.TestOneway(defaultCtx, 2) |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 316 | if err != nil { |
| 317 | t.Errorf("Unexpected error in TestOneway() call: ", err) |
| 318 | } |
| 319 | |
| 320 | //Make sure the connection still alive |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame] | 321 | if err = client.TestVoid(defaultCtx); err != nil { |
Jens Geyer | f459868 | 2014-05-08 23:18:44 +0200 | [diff] [blame] | 322 | t.Errorf("Unexpected error in TestVoid() call: ", err) |
| 323 | } |
| 324 | } |