Interface TestItemRepositoryCustom

    • Method Detail

      • findByFilter

        org.springframework.data.domain.Page<TestItem> findByFilter​(boolean isLatest,
                                                                    Queryable launchFilter,
                                                                    Queryable testItemFilter,
                                                                    org.springframework.data.domain.Pageable launchPageable,
                                                                    org.springframework.data.domain.Pageable testItemPageable)
        Executes query built for given filters and maps result for given page
        Parameters:
        isLatest - Flag for retrieving only latest launches
        launchFilter - Queryable with FilterTarget.LAUNCH_TARGET
        testItemFilter - Queryable with FilterTarget.TEST_ITEM_TARGET
        launchPageable - Pageable for Launch query
        testItemPageable - Pageable for TestItem query
        Returns:
        List of mapped entries found
      • selectAllDescendants

        java.util.List<TestItem> selectAllDescendants​(java.lang.Long itemId)
        Selects all descendants of TestItem with provided id.
        Parameters:
        itemId - TestItem id
        Returns:
        List of all descendants
      • selectAllDescendantsWithChildren

        java.util.List<TestItem> selectAllDescendantsWithChildren​(java.lang.Long itemId)
        Selects all descendants of TestItem with provided id, which has at least one child.
        Parameters:
        itemId - TestItem id
        Returns:
        List of descendants
      • selectItemsInStatusByLaunch

        java.util.List<TestItem> selectItemsInStatusByLaunch​(java.lang.Long launchId,
                                                             StatusEnum... statuses)
        Select common items object that have provided status for specified launch.
        Parameters:
        launchId - Launch
        statuses - Statuses
        Returns:
        List of items
      • selectItemsInStatusByParent

        java.util.List<TestItem> selectItemsInStatusByParent​(java.lang.Long parentId,
                                                             StatusEnum... statuses)
        Select common items object that have provided status for specified parent item.
        Parameters:
        parentId - Parent item
        statuses - Statuses
        Returns:
        List of items
      • hasItemsInStatusByLaunch

        java.lang.Boolean hasItemsInStatusByLaunch​(java.lang.Long launchId,
                                                   StatusEnum... statuses)
        True if the provided launch contains any items with a specified status.
        Parameters:
        launchId - Checking launch id
        statuses - Checking statuses
        Returns:
        True if contains, false if not
      • findAllNotInIssueByLaunch

        java.util.List<TestItem> findAllNotInIssueByLaunch​(java.lang.Long launchId,
                                                           java.lang.String locator)
        Select items that has different issue from provided for specified launch.
        Parameters:
        launchId - Launch
        locator - Issue type locator
        Returns:
        List of items
      • selectIdsNotInIssueByLaunch

        java.util.List<java.lang.Long> selectIdsNotInIssueByLaunch​(java.lang.Long launchId,
                                                                   java.lang.String locator)
        Select items that has different issue from provided for specified launch.
        Parameters:
        launchId - Launch
        locator - Issue type locator
        Returns:
        List of items
      • findAllNotInIssueGroupByLaunch

        java.util.List<TestItem> findAllNotInIssueGroupByLaunch​(java.lang.Long launchId,
                                                                TestItemIssueGroup issueGroup)
      • selectIdsNotInIssueGroupByLaunch

        java.util.List<java.lang.Long> selectIdsNotInIssueGroupByLaunch​(java.lang.Long launchId,
                                                                        TestItemIssueGroup issueGroup)
      • findAllInIssueGroupByLaunch

        java.util.List<TestItem> findAllInIssueGroupByLaunch​(java.lang.Long launchId,
                                                             TestItemIssueGroup issueGroup)
      • hasItemsInStatusAddedLately

        java.lang.Boolean hasItemsInStatusAddedLately​(java.lang.Long launchId,
                                                      java.time.Duration period,
                                                      StatusEnum... statuses)
        True if the TestItem with matching 'status' and 'launchId' was started within the provided 'period'
        Parameters:
        period - Duration
        launchId - Launch.id
        statuses - StatusEnum
        Returns:
        true if items(the item) exist(exists)
      • hasLogs

        java.lang.Boolean hasLogs​(java.lang.Long launchId,
                                  java.time.Duration period,
                                  StatusEnum... statuses)
        True if TestItem wasn't modified before the provided 'period' and has logs
        Parameters:
        launchId - Launch.id
        period - Duration
        statuses - StatusEnum
        Returns:
        true if TestItem wasn't modified before the provided 'period' and has logs
      • selectItemsInIssueByLaunch

        java.util.List<TestItem> selectItemsInIssueByLaunch​(java.lang.Long launchId,
                                                            java.lang.String issueType)
        Select test items that has issue with provided issue type for specified launch.
        Parameters:
        launchId - Launch id
        issueType - Issue type
        Returns:
        List of items
      • selectRetries

        java.util.List<TestItem> selectRetries​(java.util.List<java.lang.Long> retryOfIds)
      • selectIssueLocatorsByProject

        java.util.List<IssueType> selectIssueLocatorsByProject​(java.lang.Long projectId)
      • selectIssueTypeByLocator

        java.util.Optional<IssueType> selectIssueTypeByLocator​(java.lang.Long projectId,
                                                               java.lang.String locator)
        Selects issue type object by provided locator for specified project.
        Parameters:
        projectId - Project id
        locator - Issue type locator
        Returns:
        Issue type
      • selectPathNames

        java.util.Map<java.lang.Long,​java.lang.String> selectPathNames​(java.lang.String path)
        Select unsorted ids and names of all items in a tree till current.
        Parameters:
        path - itemPath
        Returns:
        Map of id and name
      • selectPathNames

        java.util.Map<java.lang.Long,​PathName> selectPathNames​(java.util.Collection<java.lang.Long> id,
                                                                     java.lang.Long porjectId)
        Select PathName containing ids and names of all items in a tree till current and launch name and number for each item id from the provided collection
        Parameters:
        ids - Collection of TestItem.getItemId()
        porjectId - Project
        Returns:
        id from collection -> PathName
      • updateStatusAndEndTimeById

        int updateStatusAndEndTimeById​(java.lang.Long itemId,
                                       JStatusEnum status,
                                       java.time.LocalDateTime endTime)
        Parameters:
        itemId - TestItem.itemId
        status - New status
        endTime - TestItemResults.endTime
        Returns:
        1 if updated, otherwise 0
      • selectIdsByStringPatternMatchedLogMessage

        java.util.List<java.lang.Long> selectIdsByStringPatternMatchedLogMessage​(Queryable filter,
                                                                                 java.lang.Integer logLevel,
                                                                                 java.lang.String pattern)
        Select item IDs by launch ID and issue type ID with logs which level is greater than or equal to provided and message is matched by the STRING pattern
        Parameters:
        filter - Queryable
        logLevel - Log.logLevel
        pattern - CASE SENSITIVE STRING pattern for log message search
        Returns:
        The List of the TestItem.itemId
      • selectIdsByRegexPatternMatchedLogMessage

        java.util.List<java.lang.Long> selectIdsByRegexPatternMatchedLogMessage​(Queryable filter,
                                                                                java.lang.Integer logLevel,
                                                                                java.lang.String pattern)
        Select item IDs by launch ID and issue type ID with logs which level is greater than or equal to provided and message is matched by the REGEX pattern
        Parameters:
        filter - Queryable
        logLevel - Log.logLevel
        pattern - REGEX pattern for log message search
        Returns:
        The List of the TestItem.itemId