當前位置: 首頁>>代碼示例>>Golang>>正文


Golang conn.GetResponseForMessageWithTimeout函數代碼示例

本文整理匯總了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()
}
開發者ID:Jayasagar,項目名稱:gauge,代碼行數:7,代碼來源:refactor.go

示例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)
}
開發者ID:Jayasagar,項目名稱:gauge,代碼行數:9,代碼來源:api.go

示例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)
}
開發者ID:0-T-0,項目名稱:gauge,代碼行數:11,代碼來源:specDetails.go

示例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
}
開發者ID:Jayasagar,項目名稱:gauge,代碼行數:14,代碼來源:refactor.go

示例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"}
	}
}
開發者ID:magictests,項目名稱:gauge,代碼行數:17,代碼來源:validator.go

示例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)
}
開發者ID:mattdotmatt,項目名稱:gauge,代碼行數:17,代碼來源:validate.go

示例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})
	}
}
開發者ID:Jayasagar,項目名稱:gauge,代碼行數:17,代碼來源:validator.go


注:本文中的github.com/getgauge/gauge/conn.GetResponseForMessageWithTimeout函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。