func setupServer(h *mocks.TChanTCollector) (*tchannel.Channel, error) {
	tchan, err := testutils.NewServer(&testutils.ChannelOpts{
		ServiceName: tcollectorServiceName,
	})
	if err != nil {
		return nil, err
	}

	server := thrift.NewServer(tchan)
	server.Register(gen.NewTChanTCollectorServer(h))
	return tchan, nil
}
示例#2
0
func setupServer(t *testing.T, h *mocks.TChanTCollector) *tchannel.Channel {
	tchan := testutils.NewServer(t, testutils.NewOpts().SetServiceName(tcollectorServiceName))
	server := thrift.NewServer(tchan)
	server.Register(gen.NewTChanTCollectorServer(h))
	return tchan
}