Esempio n. 1
0
func testExecute2Panics(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testExecute2Panics")
	ctx := context.Background()
	if _, err := conn.Execute2(ctx, executeQuery, executeBindVars, executeTransactionID); err == nil || !strings.Contains(err.Error(), "caught test panic") {
		t.Fatalf("unexpected panic error: %v", err)
	}
}
Esempio n. 2
0
func testExecute2(t *testing.T, conn tabletconn.TabletConn) {
	ctx := context.Background()
	ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID)
	qr, err := conn.Execute2(ctx, executeQuery, executeBindVars, executeTransactionID)
	if err != nil {
		t.Fatalf("Execute failed: %v", err)
	}
	if !reflect.DeepEqual(*qr, executeQueryResult) {
		t.Errorf("Unexpected result from Execute: got %v wanted %v", qr, executeQueryResult)
	}
}
Esempio n. 3
0
func testExecute2Error(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testExecute2Error")
	ctx := context.Background()
	_, err := conn.Execute2(ctx, executeQuery, executeBindVars, executeTransactionID)
	verifyError(t, err, "Execute")
}