use of com.epam.ta.reportportal.entity.item.TestItemResults in project service-api by reportportal.
the class ClusterItemDataProviderMockTest method getTestItemResults.
private TestItemResults getTestItemResults(Long index) {
final TestItemResults testItemResults = new TestItemResults();
testItemResults.setDuration(0.01);
testItemResults.setEndTime(LocalDateTime.now(ZoneOffset.UTC));
testItemResults.setStatus(StatusEnum.FAILED);
final IssueEntity issueEntity = getIssueEntity(index);
testItemResults.setIssue(issueEntity);
final LinkedHashSet<Statistics> statistics = getStatistics();
testItemResults.setStatistics(statistics);
return testItemResults;
}
use of com.epam.ta.reportportal.entity.item.TestItemResults in project service-api by reportportal.
the class FinishTestItemHandlerImpl method processChildItemResult.
private TestItemResults processChildItemResult(TestItem testItem, FinishTestItemRQ finishTestItemRQ, ReportPortalUser user, ReportPortalUser.ProjectDetails projectDetails, Launch launch) {
TestItemResults testItemResults = testItem.getItemResults();
StatusEnum actualStatus = fromValue(finishTestItemRQ.getStatus()).orElse(INTERRUPTED);
Optional<IssueEntity> resolvedIssue = resolveIssue(user, actualStatus, testItem, finishTestItemRQ.getIssue(), projectDetails.getProjectId());
if (testItemResults.getStatus() == IN_PROGRESS) {
testItemResults.setStatus(actualStatus);
resolvedIssue.ifPresent(issue -> updateItemIssue(testItemResults, issue));
ofNullable(testItem.getRetryOf()).ifPresentOrElse(retryOf -> {
}, () -> {
changeStatusHandler.changeParentStatus(testItem, projectDetails.getProjectId(), user);
changeStatusHandler.changeLaunchStatus(launch);
if (testItem.isHasRetries()) {
retryHandler.finishRetries(testItem.getItemId(), JStatusEnum.valueOf(actualStatus.name()), TO_LOCAL_DATE_TIME.apply(finishTestItemRQ.getEndTime()));
}
});
} else {
updateFinishedItem(testItemResults, actualStatus, resolvedIssue, testItem, user, projectDetails.getProjectId());
}
testItem.getAttributes().removeIf(attribute -> ATTRIBUTE_KEY_STATUS.equalsIgnoreCase(attribute.getKey()) && ATTRIBUTE_VALUE_INTERRUPTED.equalsIgnoreCase(attribute.getValue()));
return testItemResults;
}
use of com.epam.ta.reportportal.entity.item.TestItemResults in project commons-dao by reportportal.
the class TestItemRepositoryTest method saveItemWith700CharsTestCaseId.
@Test
void saveItemWith700CharsTestCaseId() {
String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U";
TestItem item = new TestItem();
item.setStartTime(LocalDateTime.now());
item.setName("item");
item.setPath("1.2.3");
item.setUniqueId("uniqueID");
item.setUuid("uuid");
item.setTestCaseHash(123);
item.setTestCaseId(longParam);
TestItemResults itemResults = new TestItemResults();
itemResults.setTestItem(item);
itemResults.setStatus(StatusEnum.IN_PROGRESS);
item.setItemResults(itemResults);
item.setLaunchId(1L);
item.setType(TestItemTypeEnum.STEP);
Parameter parameter = new Parameter();
item.setParameters(Sets.newLinkedHashSet(parameter));
testItemRepository.save(item);
}
use of com.epam.ta.reportportal.entity.item.TestItemResults in project commons-dao by reportportal.
the class TestItemRepositoryTest method saveItemWith700CharsParam.
@Test
void saveItemWith700CharsParam() {
String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U";
TestItem item = new TestItem();
item.setStartTime(LocalDateTime.now());
item.setName("item");
item.setPath("1.2.3");
item.setUniqueId("uniqueID");
item.setUuid("uuid");
item.setTestCaseHash(123);
TestItemResults itemResults = new TestItemResults();
itemResults.setTestItem(item);
itemResults.setStatus(StatusEnum.IN_PROGRESS);
item.setItemResults(itemResults);
item.setLaunchId(1L);
item.setType(TestItemTypeEnum.STEP);
Parameter parameter = new Parameter();
parameter.setKey(longParam);
parameter.setValue(longParam);
item.setParameters(Sets.newLinkedHashSet(parameter));
testItemRepository.save(item);
}
use of com.epam.ta.reportportal.entity.item.TestItemResults in project service-api by reportportal.
the class FinishLaunchHierarchyHandlerTest method getTestItemsWithoutChildren.
private List<TestItem> getTestItemsWithoutChildren(Launch launch) {
TestItem firstChild = new TestItem();
firstChild.setItemId(3L);
firstChild.setType(TestItemTypeEnum.STEP);
firstChild.setLaunchId(launch.getId());
firstChild.setPath("1.2.3");
firstChild.setHasStats(true);
firstChild.setHasChildren(false);
TestItemResults parentResults = new TestItemResults();
parentResults.setStatus(StatusEnum.IN_PROGRESS);
firstChild.setItemResults(parentResults);
TestItem secondChild = new TestItem();
secondChild.setItemId(4L);
secondChild.setType(TestItemTypeEnum.STEP);
secondChild.setLaunchId(launch.getId());
secondChild.setPath("1.2.4");
secondChild.setHasStats(true);
secondChild.setHasChildren(true);
TestItemResults childResults = new TestItemResults();
childResults.setStatus(StatusEnum.IN_PROGRESS);
secondChild.setItemResults(childResults);
return Lists.newArrayList(firstChild, secondChild);
}
Aggregations