public CsvExportSuite(final TestResult result) { final Map<String, String> resultMap = result.toMap(); this.status = result.getStatus() != null ? result.getStatus().value() : null; this.duration = result.getTime().getDuration() != null ? result.getTime().getDuration().toString() : null; this.start = result.getTime().getStart() != null ? new Date(result.getTime().getStart()).toString() : null; this.stop = result.getTime().getStop() != null ? new Date(result.getTime().getStop()).toString() : null; this.parentSuite = resultMap.getOrDefault("parentSuite", null); this.suite = resultMap.getOrDefault("suite", null); this.subSuite = resultMap.getOrDefault("subSuite", null); this.testClass = resultMap.getOrDefault("testClass", null); this.testMethod = resultMap.getOrDefault("testMethod", null); this.name = result.getName(); this.description = result.getDescription(); }
public void update(final Time time) { if (Objects.isNull(time)) { return; } update(firstNonNull(getStart(), MAX_VALUE), time.getStart(), Math::min, this::setStart); update(firstNonNull(getStop(), 0L), time.getStop(), Math::max, this::setStop); update(getStop(), getStart(), (a, b) -> a - b, this::setDuration); update(firstNonNull(getMinDuration(), MAX_VALUE), time.getDuration(), Math::min, this::setMinDuration); update(firstNonNull(getMaxDuration(), 0L), time.getDuration(), Math::max, this::setMaxDuration); update(firstNonNull(getSumDuration(), 0L), time.getDuration(), (a, b) -> a + b, this::setSumDuration); }
public CsvExportSuite(final TestResult result) { final Map<String, String> resultMap = result.toMap(); this.status = result.getStatus() != null ? result.getStatus().value() : null; this.duration = result.getTime().getDuration() != null ? result.getTime().getDuration().toString() : null; this.start = result.getTime().getStart() != null ? new Date(result.getTime().getStart()).toString() : null; this.stop = result.getTime().getStop() != null ? new Date(result.getTime().getStop()).toString() : null; this.parentSuite = resultMap.getOrDefault("parentSuite", null); this.suite = resultMap.getOrDefault("suite", null); this.subSuite = resultMap.getOrDefault("subSuite", null); this.testClass = resultMap.getOrDefault("testClass", null); this.testMethod = resultMap.getOrDefault("testMethod", null); this.name = result.getName(); this.description = result.getDescription(); }
public void update(final Time time) { if (Objects.isNull(time)) { return; } update(firstNonNull(getStart(), MAX_VALUE), time.getStart(), Math::min, this::setStart); update(firstNonNull(getStop(), 0L), time.getStop(), Math::max, this::setStop); update(getStop(), getStart(), (a, b) -> a - b, this::setDuration); update(firstNonNull(getMinDuration(), MAX_VALUE), time.getDuration(), Math::min, this::setMinDuration); update(firstNonNull(getMaxDuration(), 0L), time.getDuration(), Math::max, this::setMaxDuration); update(firstNonNull(getSumDuration(), 0L), time.getDuration(), (a, b) -> a + b, this::setSumDuration); }