Search in sources :

Example 1 with SuggestRq

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq in project service-api by reportportal.

the class SuggestItemService method prepareSuggestRq.

private SuggestRq prepareSuggestRq(Launch launch, Project project) {
    SuggestRq suggestRq = new SuggestRq();
    suggestRq.setLaunchId(launch.getId());
    suggestRq.setLaunchName(launch.getName());
    suggestRq.setProject(project.getId());
    suggestRq.setAnalyzerConfig(getAnalyzerConfig(project));
    return suggestRq;
}
Also used : SuggestRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq)

Example 2 with SuggestRq

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq in project service-api by reportportal.

the class SuggestItemService method prepareSuggestRq.

private SuggestRq prepareSuggestRq(TestItem testItem, Launch launch, Project project) {
    SuggestRq suggestRq = prepareSuggestRq(launch, project);
    suggestRq.setTestItemId(testItem.getItemId());
    suggestRq.setUniqueId(testItem.getUniqueId());
    suggestRq.setTestCaseHash(testItem.getTestCaseHash());
    suggestRq.setLogs(AnalyzerUtils.fromLogs(logRepository.findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(launch.getId(), Collections.singletonList(testItem.getItemId()), ERROR_INT)));
    return suggestRq;
}
Also used : SuggestRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq)

Example 3 with SuggestRq

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq in project service-api by reportportal.

the class SuggestItemService method suggestItems.

@Transactional(readOnly = true)
public List<SuggestedItem> suggestItems(Long testItemId, ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user) {
    TestItem testItem = testItemRepository.findById(testItemId).orElseThrow(() -> new ReportPortalException(ErrorType.TEST_ITEM_NOT_FOUND, testItemId));
    validateTestItem(testItem);
    Launch launch = getLaunch(testItem.getLaunchId(), projectDetails, user);
    Project project = getProjectHandler.getProject(projectDetails);
    SuggestRq suggestRq = prepareSuggestRq(testItem, launch, project);
    return getSuggestedItems(suggestRq);
}
Also used : SuggestRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq) Project(com.epam.ta.reportportal.entity.project.Project) ReportPortalException(com.epam.ta.reportportal.exception.ReportPortalException) Launch(com.epam.ta.reportportal.entity.launch.Launch) TestItem(com.epam.ta.reportportal.entity.item.TestItem) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with SuggestRq

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq in project service-api by reportportal.

the class SuggestItemService method prepareSuggestRq.

private SuggestRq prepareSuggestRq(Cluster cluster, Launch launch, Project project) {
    SuggestRq suggestRq = prepareSuggestRq(launch, project);
    suggestRq.setClusterId(cluster.getIndexId());
    return suggestRq;
}
Also used : SuggestRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq)

Example 5 with SuggestRq

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq in project service-api by reportportal.

the class SuggestItemService method suggestClusterItems.

@Transactional(readOnly = true)
public List<SuggestedItem> suggestClusterItems(Long clusterId, ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user) {
    final Cluster cluster = getClusterHandler.getById(clusterId);
    final Launch launch = getLaunch(cluster.getLaunchId(), projectDetails, user);
    final Project project = getProjectHandler.getProject(projectDetails);
    final SuggestRq suggestRq = prepareSuggestRq(cluster, launch, project);
    return getSuggestedItems(suggestRq);
}
Also used : SuggestRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq) Project(com.epam.ta.reportportal.entity.project.Project) Cluster(com.epam.ta.reportportal.entity.cluster.Cluster) Launch(com.epam.ta.reportportal.entity.launch.Launch) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SuggestRq (com.epam.ta.reportportal.core.analyzer.auto.client.model.SuggestRq)5 Launch (com.epam.ta.reportportal.entity.launch.Launch)2 Project (com.epam.ta.reportportal.entity.project.Project)2 Transactional (org.springframework.transaction.annotation.Transactional)2 Cluster (com.epam.ta.reportportal.entity.cluster.Cluster)1 TestItem (com.epam.ta.reportportal.entity.item.TestItem)1 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)1