Esempio n. 1
0
func getClients(t *testing.T, serverCh *tchannel.Channel) (gen.TChanSimpleService, gen.TChanSecondService) {
	serverInfo := serverCh.PeerInfo()
	ch := testutils.NewClient(t, nil)

	ch.Peers().Add(serverInfo.HostPort)
	client := NewClient(ch, serverInfo.ServiceName, nil)

	simpleClient := gen.NewTChanSimpleServiceClient(client)
	secondClient := gen.NewTChanSecondServiceClient(client)
	return simpleClient, secondClient
}
Esempio n. 2
0
func getClients(serverCh *tchannel.Channel) (gen.TChanSimpleService, gen.TChanSecondService, error) {
	serverInfo := serverCh.PeerInfo()
	ch, err := testutils.NewClientChannel(nil)
	if err != nil {
		return nil, nil, err
	}

	ch.Peers().Add(serverInfo.HostPort)
	client := NewClient(ch, serverInfo.ServiceName, nil)

	simpleClient := gen.NewTChanSimpleServiceClient(client)
	secondClient := gen.NewTChanSecondServiceClient(client)
	return simpleClient, secondClient, nil
}