api

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: MIT Imports: 30 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallFunc

func CallFunc(funcName string, funcParams_f interface{}) interface{}

CallFunc for BuiltinFunc and User defined func (i.e. in js files)

func ConvertCsvRowToMap

func ConvertCsvRowToMap(csvHeader []string, csvRow []interface{}) map[string]interface{}

4. data file (*_dt) / data file (inputs)

func DispatchApi

func DispatchApi(wg *sync.WaitGroup, resultsExeChan chan testcase.TestCaseExecutionInfo, baseUrl string, tcData *testcase.TestCaseDataInfo)

func GetFuncLeavesSlice

func GetFuncLeavesSlice(value interface{}) []g4json.FieldDetails

func GetOsEnviron

func GetOsEnviron() map[string]string

2. env variables (key, value), with prefix go4_

func IfValidHttp

func IfValidHttp(tcData *testcase.TestCaseDataInfo) bool

func OpenOutFileForAppend

func OpenOutFileForAppend(logFile string) *os.File

func PrepMultipart

func PrepMultipart(reqPayload map[string]interface{}, path string) (*bytes.Buffer, string, error)

func PrepPostFormPayload

func PrepPostFormPayload(reqPayload map[string]interface{}) *strings.Reader

func PrepPostPayload

func PrepPostPayload(reqPayload map[string]interface{}) *strings.Reader

func RunRedis

func RunRedis(cmdStr string, cmdKey string, cmdValue string) (int, interface{}, string)

func RunSql

func RunSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)

func SaveHttpRespFile

func SaveHttpRespFile(actualBody []byte, outputsFile string)

func SaveJsonToCsvFile

func SaveJsonToCsvFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, targetHeader []string, outputsFile string)

func SaveJsonToExcelFile

func SaveJsonToExcelFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, targetHeader []string, outputsFile string)

Types

type TcDataStore

type TcDataStore struct {
	TcData *testcase.TestCaseDataInfo

	TcLocalVariables map[string]interface{}

	HttpExpStatus        map[string]interface{}
	HttpExpHeader        map[string]interface{}
	HttpExpBody          map[string]interface{}
	HttpActualStatusCode int
	HttpActualHeader     map[string][]string
	HttpActualBody       []byte

	HttpUrl string

	CmdSection     string // setUp, tearDown
	CmdGroupLength int

	CmdType          string // sql, redis, init, etc.
	CmdExecStatus    string
	CmdAffectedCount int
	CmdResults       interface{}
}

func InitTcDataStore

func InitTcDataStore(tcData *testcase.TestCaseDataInfo) *TcDataStore

func (*TcDataStore) CallHttp

func (tcDataStore *TcDataStore) CallHttp(baseUrl string)

func (*TcDataStore) CommandGroup

func (tcDataStore *TcDataStore) CommandGroup(cmdGroupOrigin []*testcase.CommandDetails) (string, [][]*testcase.TestMessage)

func (*TcDataStore) Compare

func (tcDataStore *TcDataStore) Compare() (string, []*testcase.TestMessage)

func (*TcDataStore) CompareBody

func (tcDataStore *TcDataStore) CompareBody() ([]bool, []*testcase.TestMessage)

func (*TcDataStore) CompareHeaders

func (tcDataStore *TcDataStore) CompareHeaders() ([]bool, []*testcase.TestMessage)

func (*TcDataStore) CompareRespGroup

func (tcDataStore *TcDataStore) CompareRespGroup(cmdExpResp map[string]interface{}) (bool, []*testcase.TestMessage)

func (*TcDataStore) CompareStatus

func (tcDataStore *TcDataStore) CompareStatus() ([]bool, []*testcase.TestMessage)

func (*TcDataStore) EvaluateEmbeddedFunctions

func (tcDataStore *TcDataStore) EvaluateEmbeddedFunctions(value interface{}) interface{}

func (*TcDataStore) EvaluateTcEmbeddedFunctions

func (tcDataStore *TcDataStore) EvaluateTcEmbeddedFunctions(path string, res interface{})

func (*TcDataStore) GetBodyActualValueByPath

func (tcDataStore *TcDataStore) GetBodyActualValueByPath(key string) interface{}

func (*TcDataStore) GetHeadersActualValue

func (tcDataStore *TcDataStore) GetHeadersActualValue(key string) interface{}

func (*TcDataStore) GetOutputsCsvData

func (tcDataStore *TcDataStore) GetOutputsCsvData(outputsData map[string][]interface{}) ([]string, []string)

func (*TcDataStore) GetOutputsDetailsDataForFieldSlice

func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldSlice(valueSlice []interface{}) []interface{}

func (*TcDataStore) GetOutputsDetailsDataForFieldString

func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldString(valueSlice []interface{}) []string

func (*TcDataStore) GetRedisActualValueByPath

func (tcDataStore *TcDataStore) GetRedisActualValueByPath(searchPath string) interface{}

func (*TcDataStore) GetResponseValue

func (tcDataStore *TcDataStore) GetResponseValue(searchPath string) interface{}

func (*TcDataStore) GetSqlActualValueByPath

func (tcDataStore *TcDataStore) GetSqlActualValueByPath(searchPath string) interface{}

func (*TcDataStore) GetStatusActualValue

func (tcDataStore *TcDataStore) GetStatusActualValue(key string) interface{}

func (*TcDataStore) HandleCmdResultsForOut

func (tcDataStore *TcDataStore) HandleCmdResultsForOut(i int)

func (*TcDataStore) HandleHttpResultsForOut

func (tcDataStore *TcDataStore) HandleHttpResultsForOut()

func (*TcDataStore) HandleInitCmd

func (tcDataStore *TcDataStore) HandleInitCmd(i int) ([]bool, [][]*testcase.TestMessage)

func (*TcDataStore) HandleOutFiles

func (tcDataStore *TcDataStore) HandleOutFiles(expOutFiles []*testcase.OutFilesDetails)

func (*TcDataStore) HandleRedisCmd

func (tcDataStore *TcDataStore) HandleRedisCmd(i int) ([]bool, [][]*testcase.TestMessage)

func (*TcDataStore) HandleSingleCmdResult

func (tcDataStore *TcDataStore) HandleSingleCmdResult(i int) ([]bool, [][]*testcase.TestMessage)

func (*TcDataStore) HandleSqlCmd

func (tcDataStore *TcDataStore) HandleSqlCmd(i int) ([]bool, [][]*testcase.TestMessage)

func (*TcDataStore) IfCmdResultsPrimitive

func (tcDataStore *TcDataStore) IfCmdResultsPrimitive() bool

func (*TcDataStore) IterateFuncs

func (tcDataStore *TcDataStore) IterateFuncs(jsonStr string, funcLeavesSlice []g4json.FieldDetails, maxLevel int) string

func (*TcDataStore) MergeTestData

func (tcDataStore *TcDataStore) MergeTestData() map[string]interface{}

Note: here may occur: fatal error: concurrent map iteration and map write, => need to fix

func (*TcDataStore) PrepEmbeddedFunctions

func (tcDataStore *TcDataStore) PrepEmbeddedFunctions(path string)

for http: .request, .response, .session, .outGlobalVariables, .outLocalVariables, .outFiles for cmd (setUp, tearDown): .cmd, .cmdResponse, .session, .outGlobalVariables, .outLocalVariables, .outFiles

func (*TcDataStore) RenderTcVariables

func (tcDataStore *TcDataStore) RenderTcVariables(path string, res interface{})

func (*TcDataStore) RunHttp

func (tcDataStore *TcDataStore) RunHttp(baseUrl string) (string, []*testcase.TestMessage)

func (*TcDataStore) RunTcSetUp

func (tcDataStore *TcDataStore) RunTcSetUp() (string, [][]*testcase.TestMessage)

Note: for each SetUp, TesrDown, it may have more than one Command (including sql) for each Command, it may have more than one assertion

func (*TcDataStore) RunTcTearDown

func (tcDataStore *TcDataStore) RunTcTearDown() (string, [][]*testcase.TestMessage)

func (*TcDataStore) WriteOutGlobalVariables

func (tcDataStore *TcDataStore) WriteOutGlobalVariables(expOutGlobalVariables map[string]interface{})

func (*TcDataStore) WriteOutTcLocalVariables

func (tcDataStore *TcDataStore) WriteOutTcLocalVariables(expOutLocalVariables map[string]interface{})

func (*TcDataStore) WriteOutputsDataToFile

func (tcDataStore *TcDataStore) WriteOutputsDataToFile()

func (*TcDataStore) WriteSession

func (tcDataStore *TcDataStore) WriteSession(expTcSession map[string]interface{})

Jump to

Keyboard shortcuts

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