コード例 #1
0
func (r *ExecutionStartingRequestProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {

	tags := msg.GetExecutionStartingRequest().GetCurrentExecutionInfo().GetCurrentScenario().GetTags()
	hooks := context.GetHooks(t.BEFORESUITE, tags)

	return executeHooks(hooks, msg)
}
コード例 #2
0
func (r *StepExecutionEndingProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	tags := msg.GetStepExecutionEndingRequest().GetCurrentExecutionInfo().GetCurrentSpec().GetTags()
	hooks := context.GetHooks(t.AFTERSTEP, tags)

	res := executeHooks(hooks, msg)
	res.GetExecutionStatusResponse().GetExecutionResult().Message = context.CustomMessageRegistry
	context.ClearCustomMessages()

	return res
}
コード例 #3
0
func (r *ExecuteStepProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	step, err := context.GetStepByDesc(*msg.ExecuteStepRequest.ParsedStepText)
	if err != nil {
		// if step implementation not found
		fmt.Println(err.Error())
	}
	args := getArgs(msg.ExecuteStepRequest)
	exeRes := step.Execute(args...)

	return &m.Message{
		MessageType: m.Message_ExecutionStatusResponse.Enum(),
		MessageId:   msg.MessageId,
		ExecutionStatusResponse: &m.ExecutionStatusResponse{
			ExecutionResult: exeRes,
		},
	}
}
コード例 #4
0
func (r *SpecExecutionEndingProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	tags := msg.GetSpecExecutionEndingRequest().GetCurrentExecutionInfo().GetCurrentSpec().GetTags()
	hooks := context.GetHooks(t.AFTERSPEC, tags)

	return executeHooks(hooks, msg)
}
コード例 #5
0
func (r *ScenarioDataStoreInitProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	context.ScenarioStore = make(map[string]interface{})
	return createResponseMessage(msg.MessageId, int64(0), nil)
}
コード例 #6
0
func (s *SuiteDataStoreInitRequestProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	context.SuiteStore = make(map[string]interface{})
	return createResponseMessage(msg.MessageId, int64(0), nil)
}
コード例 #7
0
func (r *StepExecutionStartingRequestProcessor) Process(msg *m.Message, context *t.GaugeContext) *m.Message {
	tags := msg.GetStepExecutionStartingRequest().GetCurrentExecutionInfo().GetCurrentSpec().GetTags()
	hooks := context.GetHooks(t.BEFORESTEP, tags)
	context.ClearCustomMessages()
	return executeHooks(hooks, msg)
}