Пример #1
0
func (self *XmlBuilder) getTestSuite(result *gauge_messages.ProtoSpecResult, hostName string) JUnitTestSuite {
	now := time.Now()
	formattedNow := fmt.Sprintf(timeStampFormat, now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
	systemError := SystemErr{}
	if result.GetScenarioSkippedCount() > 0 {
		systemError.Contents = fmt.Sprintf("Validation failed, %d Scenarios were skipped.", result.GetScenarioSkippedCount())
	}
	return JUnitTestSuite{
		Id:               int(self.currentId),
		Tests:            int(result.GetScenarioCount()),
		Failures:         int(result.GetScenarioFailedCount()),
		Time:             formatTime(int(result.GetExecutionTime())),
		Timestamp:        formattedNow,
		Name:             result.GetProtoSpec().GetSpecHeading(),
		Errors:           0,
		Hostname:         hostName,
		Package:          result.GetProtoSpec().GetFileName(),
		Properties:       []JUnitProperty{},
		TestCases:        []JUnitTestCase{},
		SkippedTestCount: int(result.GetScenarioSkippedCount()),
		SystemOutput:     SystemOut{},
		SystemError:      systemError,
	}
}