예제 #1
0
func (self *XmlBuilder) getFailure(test *gauge_messages.ProtoScenario) (string, string) {
	msg, content := self.getFailureFromExecutionResult(test.GetPreHookFailure(), test.GetPostHookFailure(), nil, "Scenario ")
	return self.perform(msg, content, func(test *gauge_messages.ProtoScenario) (string, string) {
		msg, content = self.getFailureFromSteps(test.GetContexts())
		return self.perform(msg, content, func(test *gauge_messages.ProtoScenario) (string, string) {
			return self.getFailureFromSteps(test.GetScenarioItems())
		}, test)
	}, test)
}
예제 #2
0
func (self *XmlBuilder) getScenarioContent(result *gauge_messages.ProtoSpecResult, scenario *gauge_messages.ProtoScenario, ts *JUnitTestSuite) {
	testCase := JUnitTestCase{
		Classname: result.GetProtoSpec().GetSpecHeading(),
		Name:      scenario.GetScenarioHeading(),
		Time:      formatTime(int(scenario.GetExecutionTime())),
		Failure:   nil,
	}
	if scenario.GetFailed() {
		message, content := self.getFailure(scenario)
		testCase.Failure = &JUnitFailure{
			Message:  message,
			Type:     message,
			Contents: content,
		}
	} else if scenario.GetSkipped() {
		testCase.SkipMessage = &JUnitSkipMessage{
			Message: strings.Join(scenario.SkipErrors, "\n"),
		}
	}
	ts.TestCases = append(ts.TestCases, testCase)
}