default void updateStatistic(Statusable statusable) { if (statusable == null) { return; } if (getStatistic() == null) { setStatistic(new Statistic()); } getStatistic().update(statusable.getStatus()); } }
default void updateStatistic(Statistic other) { getStatistic().setFailed(other.getFailed() + getStatistic().getFailed()); getStatistic().setBroken(other.getBroken() + getStatistic().getBroken()); getStatistic().setPassed(other.getPassed() + getStatistic().getPassed()); getStatistic().setSkipped(other.getSkipped() + getStatistic().getSkipped()); getStatistic().setUnknown(other.getUnknown() + getStatistic().getUnknown()); }
private TestResult createTestResult(String name, String historyId, long start, long stop) { return new TestResult() .setName(name) .setHistoryId(historyId) .setStatus(Status.BROKEN) .setTime(new Time().setStart(start).setStop(stop)); } }
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 Optional<String> findOneLabel(final LabelName name) { return findOneLabel(name.value()); }
public <T> T findAllLabels(final LabelName name, final Collector<String, ?, T> collector) { return findAllLabels(name.value(), collector); }
public void addLabelIfNotExists(final LabelName name, final String value) { addLabelIfNotExists(name.value(), value); }
default void addLabelIfNotExists(LabelName name, String value) { addLabelIfNotExists(name.value(), value); }
default void updateTime(Timeable timed) { getTimeSafe().update(timed.getTime()); }
default void updateTime(GroupTime groupTime) { getTimeSafe().merge(groupTime); }