func doTestRequest(req *message.Request, conf *config.ServantConfig, stCh chan<- string) *message.Response { res := new(message.Response) res.NID = req.NID res.RC = 1 res.Detail = "detail" res.JID = req.JID res.Stat = db.NORMAL res.St = "20150331131524.123456789" res.Et = "20150331131525.123456789" return res }
func testSendRequest_Abnormal(host string, port int, reqMsg string, stCh chan<- string) (string, error) { req := new(message.Request) req.ParseJSON("reqMsg") res := new(message.Response) res.NID = req.NID res.JID = req.JID res.RC = 1 res.Stat = 9 res.Detail = "testerror" res.Var = "testvar" res.St = "2015-04-01 12:34:56.789" res.Et = "2015-04-01 12:35:46.123" resMsg, _ := res.GenerateJSON() return resMsg, nil }