本文整理匯總了Golang中github.com/getgauge/gauge/conn.GetResponseForMessageWithTimeout函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetResponseForMessageWithTimeout函數的具體用法?Golang GetResponseForMessageWithTimeout怎麽用?Golang GetResponseForMessageWithTimeout使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetResponseForMessageWithTimeout函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: sendRefactorRequest
func (agent *rephraseRefactorer) sendRefactorRequest(testRunner *testRunner, refactorRequest *gauge_messages.Message) *gauge_messages.RefactorResponse {
response, err := conn.GetResponseForMessageWithTimeout(refactorRequest, testRunner.connection, config.RefactorTimeout())
if err != nil {
return &gauge_messages.RefactorResponse{Success: proto.Bool(false), Error: proto.String(err.Error())}
}
return response.GetRefactorResponse()
}
示例2: requestForSteps
func requestForSteps(runner *testRunner) []string {
message, err := conn.GetResponseForMessageWithTimeout(createGetStepNamesRequest(), runner.connection, config.RunnerRequestTimeout())
if err == nil {
allStepsResponse := message.GetStepNamesResponse()
return allStepsResponse.GetSteps()
}
logger.ApiLog.Error("Error response from runner on getStepNamesRequest: %s", err)
return make([]string, 0)
}
示例3: getImplementedSteps
func (s *SpecInfoGatherer) getImplementedSteps(runner *runner.TestRunner) []*gauge.StepValue {
stepValues := make([]*gauge.StepValue, 0)
message, err := conn.GetResponseForMessageWithTimeout(createGetStepNamesRequest(), runner.Connection, config.RunnerRequestTimeout())
if err != nil {
logger.APILog.Error("Error response from runner on getStepNamesRequest: %s", err)
return stepValues
}
allSteps := message.GetStepNamesResponse().GetSteps()
return s.getParsedStepValues(allSteps)
}
示例4: getStepNameFromRunner
func (agent *rephraseRefactorer) getStepNameFromRunner(runner *testRunner) (string, error, *warning) {
stepNameMessage := &gauge_messages.Message{MessageType: gauge_messages.Message_StepNameRequest.Enum(), StepNameRequest: &gauge_messages.StepNameRequest{StepValue: proto.String(agent.oldStep.value)}}
responseMessage, err := conn.GetResponseForMessageWithTimeout(stepNameMessage, runner.connection, config.RunnerRequestTimeout())
if err != nil {
return "", err, nil
}
if !(responseMessage.GetStepNameResponse().GetIsStepPresent()) {
return "", nil, &warning{message: fmt.Sprintf("Step implementation not found: %s", agent.oldStep.lineText)}
}
if responseMessage.GetStepNameResponse().GetHasAlias() {
return "", errors.New(fmt.Sprintf("steps with aliases : '%s' cannot be refactored.", strings.Join(responseMessage.GetStepNameResponse().GetStepName(), "', '"))), nil
}
return responseMessage.GetStepNameResponse().GetStepName()[0], nil, nil
}
示例5: validateStep
func (self *specValidator) validateStep(step *parser.Step) *stepValidationError {
message := &gauge_messages.Message{MessageType: gauge_messages.Message_StepValidateRequest.Enum(),
StepValidateRequest: &gauge_messages.StepValidateRequest{StepText: proto.String(step.Value), NumberOfParameters: proto.Int(len(step.Args))}}
response, err := conn.GetResponseForMessageWithTimeout(message, self.runner.Connection, config.RunnerRequestTimeout())
if err != nil {
return &stepValidationError{step: step, message: err.Error(), fileName: self.specification.FileName}
}
if response.GetMessageType() == gauge_messages.Message_StepValidateResponse {
validateResponse := response.GetStepValidateResponse()
if !validateResponse.GetIsValid() {
return &stepValidationError{step: step, fileName: self.specification.FileName, errorType: validateResponse.ErrorType, message: *validateResponse.ErrorMessage}
}
return nil
} else {
return &stepValidationError{step: step, fileName: self.specification.FileName, errorType: &invalidResponse, message: "Invalid response from runner for Validation request"}
}
}
示例6: validateStep
func (v *specValidator) validateStep(s *gauge.Step) *StepValidationError {
m := &gauge_messages.Message{MessageType: gauge_messages.Message_StepValidateRequest.Enum(),
StepValidateRequest: &gauge_messages.StepValidateRequest{StepText: proto.String(s.Value), NumberOfParameters: proto.Int(len(s.Args))}}
r, err := conn.GetResponseForMessageWithTimeout(m, v.runner.Connection, config.RunnerRequestTimeout())
if err != nil {
return NewValidationError(s, err.Error(), v.specification.FileName, nil)
}
if r.GetMessageType() == gauge_messages.Message_StepValidateResponse {
res := r.GetStepValidateResponse()
if !res.GetIsValid() {
msg := getMessage(res.ErrorType.String())
return NewValidationError(s, msg, v.specification.FileName, res.ErrorType)
}
return nil
}
return NewValidationError(s, "Invalid response from runner for Validation request", v.specification.FileName, &invalidResponse)
}
示例7: validateStep
func (self *specValidator) validateStep(step *step) {
message := &gauge_messages.Message{MessageType: gauge_messages.Message_StepValidateRequest.Enum(),
StepValidateRequest: &gauge_messages.StepValidateRequest{StepText: proto.String(step.value), NumberOfParameters: proto.Int(len(step.args))}}
response, err := conn.GetResponseForMessageWithTimeout(message, self.runner.connection, config.RunnerRequestTimeout())
if err != nil {
self.stepValidationErrors = append(self.stepValidationErrors, &stepValidationError{step: step, message: err.Error(), fileName: self.specification.fileName})
return
}
if response.GetMessageType() == gauge_messages.Message_StepValidateResponse {
validateResponse := response.GetStepValidateResponse()
if !validateResponse.GetIsValid() {
self.stepValidationErrors = append(self.stepValidationErrors, &stepValidationError{step: step, message: validateResponse.GetErrorMessage(), fileName: self.specification.fileName})
}
} else {
self.stepValidationErrors = append(self.stepValidationErrors, &stepValidationError{step: step, message: "Invalid response from runner for Validation request", fileName: self.specification.fileName})
}
}