public static Time create(final Long duration) { return new Time().setDuration(duration); }
private Time convert(final Long start, final Long stop) { return new Time() .setStart(start) .setStop(stop) .setDuration(nonNull(start) && nonNull(stop) ? stop - start : null); }
public static Time create(final Long start, final Long stop) { return new Time() .setStart(start) .setStop(stop) .setDuration(isNull(start) || isNull(stop) ? null : stop - start); }
@Issue("587") @Issue("572") @Test public void shouldSortByStartTimeAsc() throws Exception { final TestResult first = new TestResult() .setName("first") .setTime(new Time().setStart(10L)); final TestResult second = new TestResult() .setName("second") .setTime(new Time().setStart(100L)); final TestResult third = new TestResult() .setName("third") .setTime(new Time().setStart(50L)); final TestResult timeless = new TestResult() .setName("timeless"); final LaunchResults results = new DefaultLaunchResults( new HashSet<>(Arrays.asList(first, second, third, timeless)), Collections.emptyMap(), Collections.emptyMap() ); final PackagesPlugin packagesPlugin = new PackagesPlugin(); final Tree<TestResult> tree = packagesPlugin.getData(singletonList(results)); assertThat(tree.getChildren()) .extracting("name") .containsExactly("timeless", "first", "third", "second"); } }
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)); } }
@Issue("587") @Issue("572") @Test public void shouldSortByStartTimeAsc() throws Exception { final TestResult first = new TestResult() .setName("first") .setTime(new Time().setStart(10L)); final TestResult second = new TestResult() .setName("second") .setTime(new Time().setStart(12L)); final TestResult timeless = new TestResult() .setName("timeless"); final Tree<TestResult> tree = SuitesPlugin.getData( createSingleLaunchResults(second, first, timeless) ); assertThat(tree.getChildren()) .extracting(TreeNode::getName) .containsExactly("timeless", "first", "second"); }
@Issue("587") @Issue("572") @Test public void shouldSortByStartTimeAsc() throws Exception { final Category category = new Category().setName("some"); final TestResult first = new TestResult() .setName("first") .setStatus(Status.FAILED) .setTime(new Time().setStart(10L)); first.addExtraBlock(CATEGORIES, singletonList(category)); final TestResult second = new TestResult() .setName("second") .setStatus(Status.FAILED) .setTime(new Time().setStart(12L)); second.addExtraBlock(CATEGORIES, singletonList(category)); final TestResult timeless = new TestResult() .setName("timeless") .setStatus(Status.FAILED); timeless.addExtraBlock(CATEGORIES, singletonList(category)); final Tree<TestResult> tree = CategoriesPlugin.getData( createSingleLaunchResults(second, first, timeless) ); assertThat(tree.getChildren()) .flatExtracting("children") .flatExtracting("children") .extracting("name") .containsExactly("timeless", "first", "second"); }
private Step convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Step s, final Status testStatus, final String message, final String trace) { final Status status = convert(s.getStatus()); final Step current = new Step() .setName(s.getTitle() == null ? s.getName() : s.getTitle()) .setTime(new Time() .setStart(s.getStart()) .setStop(s.getStop()) .setDuration(s.getStop() - s.getStart())) .setStatus(status) .setSteps(convert(s.getSteps(), step -> convert(source, visitor, step, testStatus, message, trace))) .setAttachments(convert(s.getAttachments(), attach -> convert(source, visitor, attach))); //Copy test status details to each step set the same status if (Objects.equals(status, testStatus)) { current.setStatusMessage(message); current.setStatusMessage(trace); } return current; }
public static Time create(final Long duration) { return new Time().setDuration(duration); }
private Time convert(final Long start, final Long stop) { return new Time() .setStart(start) .setStop(stop) .setDuration(nonNull(start) && nonNull(stop) ? stop - start : null); }
public static Time create(final Long start, final Long stop) { return new Time() .setStart(start) .setStop(stop) .setDuration(isNull(start) || isNull(stop) ? null : stop - start); }
private Step convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Step s, final Status testStatus, final String message, final String trace) { final Status status = convert(s.getStatus()); final Step current = new Step() .setName(s.getTitle() == null ? s.getName() : s.getTitle()) .setTime(new Time() .setStart(s.getStart()) .setStop(s.getStop()) .setDuration(s.getStop() - s.getStart())) .setStatus(status) .setSteps(convert(s.getSteps(), step -> convert(source, visitor, step, testStatus, message, trace))) .setAttachments(convert(s.getAttachments(), attach -> convert(source, visitor, attach))); //Copy test status details to each step set the same status if (Objects.equals(status, testStatus)) { current.setStatusMessage(message); current.setStatusMessage(trace); } return current; }