testing

package
v0.0.0-...-580505f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbForTest *sql.DB

Functions

func DefaultListenAndExecute

func DefaultListenAndExecute(
	rcvr interface{}, rpcCallback func(*RpcTestEnv),
)

func ExecuteInTx

func ExecuteInTx(txCallback func(*sql.Tx))

IoC execution(in transaction)

func ExecuteOrFail

func ExecuteOrFail(query string, args ...interface{}) sql.Result

IoC execution

func ExecuteQueriesOrFailInTx

func ExecuteQueriesOrFailInTx(queries ...string)

IoC execution(in transaction)

func HasDbEnvForMysqlOrSkip

func HasDbEnvForMysqlOrSkip(c *C) bool

Checks whether or not skipping testing by viable arguments

func InitDb

func InitDb()

func QueryForRow

func QueryForRow(
	rowCallback func(row *sql.Row),
	sqlQuery string, args ...interface{},
)

IoC Callback for row This method would use sql.DB.QueryRow method to retrive data

func QueryForRows

func QueryForRows(
	rowsCallback func(row *sql.Rows),
	sqlQuery string, args ...interface{},
)

IoC Callback for rows This method would use sql.DB.Query method to retrive data

func ReleaseDb

func ReleaseDb()

Types

type RpcTestEnv

type RpcTestEnv struct {
	Port      int
	RpcClient *rpc.Client
	// contains filtered or unexported fields
}

func (*RpcTestEnv) ListenAndExecute

func (rpcTestEnvInstance *RpcTestEnv) ListenAndExecute(
	rcvr interface{}, rpcCallback func(*RpcTestEnv),
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL