Documentation ¶
Index ¶
- Variables
- func CallMockJsonRpc(method string, params interface{}, reply interface{}) error
- func DefaultListenAndExecute(rcvr interface{}, rpcCallback func(*RpcTestEnv))
- func ExecuteInTx(txCallback func(*sql.Tx))
- func ExecuteOrFail(query string, args ...interface{}) sql.Result
- func ExecuteQueriesOrFailInTx(queries ...string)
- func GetUrlOfMockedServer() string
- func HasDefaultOrmOnPortal(c *C) bool
- func HasTestDbConfig() bool
- func InitDb()
- func InitOrm()
- func QueryForRow(rowCallback func(row *sql.Row), sqlQuery string, args ...interface{})
- func QueryForRows(rowsCallback func(row *sql.Rows), sqlQuery string, args ...interface{})
- func ReleaseDb()
- func StartMockJsonRpcServer(c *C, jsonrpcServiceSetupFunc func(*rpc.Server))
- func StopMockJsonRpcServer(c *C)
- type RpcTestEnv
Constants ¶
This section is empty.
Variables ¶
View Source
var DbForTest *sql.DB
Functions ¶
func CallMockJsonRpc ¶
Calls the JSONRPC service provided by StartMockJsonRpcServer
func DefaultListenAndExecute ¶
func DefaultListenAndExecute( rcvr interface{}, rpcCallback func(*RpcTestEnv), )
func ExecuteQueriesOrFailInTx ¶
func ExecuteQueriesOrFailInTx(queries ...string)
IoC execution(in transaction)
func HasDefaultOrmOnPortal ¶
func HasDefaultOrmOnPortal(c *C) bool
Checks whether or not skipping testing by viable arguments
func QueryForRow ¶
IoC Callback for row This method would use sql.DB.QueryRow method to retrive data
func QueryForRows ¶
IoC Callback for rows This method would use sql.DB.Query method to retrive data
func StartMockJsonRpcServer ¶
func StartMockJsonRpcServer(c *C, jsonrpcServiceSetupFunc func(*rpc.Server))
Initialize mock JSONRPC server for NQM log You may use "test.mockrpc.port" to customize port of HTTP for it
func StopMockJsonRpcServer ¶
func StopMockJsonRpcServer(c *C)
Stops the HTTP server for mocked JSONRPC services
Types ¶
type RpcTestEnv ¶
func (*RpcTestEnv) ListenAndExecute ¶
func (rpcTestEnvInstance *RpcTestEnv) ListenAndExecute( rcvr interface{}, rpcCallback func(*RpcTestEnv), )
Click to show internal directories.
Click to hide internal directories.