Documentation ¶
Overview ¶
Package tabletconntest provides the test methods to make sure a tabletconn/queryservice pair over RPC works correctly.
Index ¶
- func TestErrorSuite(t *testing.T, protocol string, endPoint *pbt.EndPoint, fake *FakeQueryService)
- func TestSuite(t *testing.T, protocol string, endPoint *pbt.EndPoint, fake *FakeQueryService)
- type FakeQueryService
- func (f *FakeQueryService) Begin(ctx context.Context, target *pb.Target, session *proto.Session, ...) error
- func (f *FakeQueryService) Commit(ctx context.Context, target *pb.Target, session *proto.Session) error
- func (f *FakeQueryService) Execute(ctx context.Context, target *pb.Target, query *proto.Query, ...) error
- func (f *FakeQueryService) ExecuteBatch(ctx context.Context, target *pb.Target, queryList *proto.QueryList, ...) error
- func (f *FakeQueryService) GetSessionId(sessionParams *proto.SessionParams, sessionInfo *proto.SessionInfo) error
- func (f *FakeQueryService) HandlePanic(err *error)
- func (f *FakeQueryService) Rollback(ctx context.Context, target *pb.Target, session *proto.Session) error
- func (f *FakeQueryService) SplitQuery(ctx context.Context, target *pb.Target, req *proto.SplitQueryRequest, ...) error
- func (f *FakeQueryService) StreamExecute(ctx context.Context, target *pb.Target, query *proto.Query, ...) error
- func (f *FakeQueryService) StreamHealthRegister(c chan<- *pb.StreamHealthResponse) (int, error)
- func (f *FakeQueryService) StreamHealthUnregister(int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestErrorSuite ¶
TestErrorSuite runs all the tests that expect errors
Types ¶
type FakeQueryService ¶
type FakeQueryService struct {
// contains filtered or unexported fields
}
FakeQueryService has the server side of this fake
func CreateFakeServer ¶
func CreateFakeServer(t *testing.T) *FakeQueryService
CreateFakeServer returns the fake server for the tests
func (*FakeQueryService) Begin ¶
func (f *FakeQueryService) Begin(ctx context.Context, target *pb.Target, session *proto.Session, txInfo *proto.TransactionInfo) error
Begin is part of the queryservice.QueryService interface
func (*FakeQueryService) Commit ¶
func (f *FakeQueryService) Commit(ctx context.Context, target *pb.Target, session *proto.Session) error
Commit is part of the queryservice.QueryService interface
func (*FakeQueryService) Execute ¶
func (f *FakeQueryService) Execute(ctx context.Context, target *pb.Target, query *proto.Query, reply *mproto.QueryResult) error
Execute is part of the queryservice.QueryService interface
func (*FakeQueryService) ExecuteBatch ¶
func (f *FakeQueryService) ExecuteBatch(ctx context.Context, target *pb.Target, queryList *proto.QueryList, reply *proto.QueryResultList) error
ExecuteBatch is part of the queryservice.QueryService interface
func (*FakeQueryService) GetSessionId ¶
func (f *FakeQueryService) GetSessionId(sessionParams *proto.SessionParams, sessionInfo *proto.SessionInfo) error
GetSessionId is part of the queryservice.QueryService interface
func (*FakeQueryService) HandlePanic ¶
func (f *FakeQueryService) HandlePanic(err *error)
HandlePanic is part of the queryservice.QueryService interface
func (*FakeQueryService) Rollback ¶
func (f *FakeQueryService) Rollback(ctx context.Context, target *pb.Target, session *proto.Session) error
Rollback is part of the queryservice.QueryService interface
func (*FakeQueryService) SplitQuery ¶
func (f *FakeQueryService) SplitQuery(ctx context.Context, target *pb.Target, req *proto.SplitQueryRequest, reply *proto.SplitQueryResult) error
SplitQuery is part of the queryservice.QueryService interface
func (*FakeQueryService) StreamExecute ¶
func (f *FakeQueryService) StreamExecute(ctx context.Context, target *pb.Target, query *proto.Query, sendReply func(*mproto.QueryResult) error) error
StreamExecute is part of the queryservice.QueryService interface
func (*FakeQueryService) StreamHealthRegister ¶
func (f *FakeQueryService) StreamHealthRegister(c chan<- *pb.StreamHealthResponse) (int, error)
StreamHealthRegister is part of the queryservice.QueryService interface
func (*FakeQueryService) StreamHealthUnregister ¶
func (f *FakeQueryService) StreamHealthUnregister(int) error
StreamHealthUnregister is part of the queryservice.QueryService interface