Package com.polarion.alm.tracker
Interface ITestManagementService
public interface ITestManagementService
- Since:
- 3.6.0
- Author:
- Miroslav Ruza
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateOrFindTestCaseWorkItem
(String projectId, String testCaseId, IWorkItem template) Finds a Work Item in the specified project with the type specified byTestsConfiguration.getTestCaseWorkItemType()
that has the same value in the custom field specified byTestsConfiguration.getTestCaseIdCustomField()
as thetestCaseId
parameter.createTestRun
(String projectId, String id, String templateId) Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template.createTestRun
(String projectId, String id, String templateId, boolean asTemplate) Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template.createTestsFileProcessor
(String projectId, String id) Creates a tests file processor.void
deleteTestRuns
(Collection<ITestRun> testRuns) Deletes the Test Runs specified in the input set.getConfiguration
(String projectId) Returns the test configuration that also contains the genericTestRunsConfiguration
.getConfiguredDefectToTestCaseLinkRole
(String projectId) Deprecated, for removal: This API element is subject to removal in a future version.getConfiguredDefectToTestCaseLinkRole
(String projectId, String typeId) getLastTestRecords
(IWorkItem testCase, int count) Returns the latest Test Records by execution time for the test case.getLightweightTestRun
(String projectId, String id) Deprecated.Since 3.10.3, now equivalent togetTestRun(String, String)
.Finds the Test Run's currently running, but incomplete, Test Results import job.getTestCaseFailureConfiguration
(String projectId, String testRunTypeId, String testCaseTypeId) Returns the testing configuration for the given test case Work Item type.getTestRecordResultEnum
(String projectId) getTestRun
(String projectId, String id) Returns a Test Run from the specified project with the specified id.getTestRun
(String projectId, String id, String revision) Returns a Test Run from the specified project with the specified id and revision.getTestRunsConfiguration
(String projectId, String typeId) Returns the Test Run configuration for the given Test Run type.getTestRunStatusEnum
(String projectId) getTestRunTypeEnum
(String projectId) getTestSteps
(IWorkItem testCase) getTestStepsCustomField
(IWorkItem testCase) getTestStepsCustomField
(String projectId, String wiType) getTestStepsKeys
(String projectId) Returns the default Test Step keys for all Work Item types.getTestStepsKeys
(String projectId, String wiType) Returns Test Step keys for a specific Work Item type.boolean
isAutomatedTestCase
(IWorkItem workItem) Checks if the given Work Item was created by thecreateOrFindTestCaseWorkItem(String, String, IWorkItem)
method by checking if it has a populated custom field that is fille-in by thecreateOrFindTestCaseWorkItem(String, String, IWorkItem)
method.boolean
isConfigurationDefined
(String projectId) void
saveConfiguration
(String projectId, TestsConfiguration configuration) Saves the test's configuration and the contained genericTestRunsConfiguration
andTestCaseFailureConfiguration
.searchTestRecords
(String query, String sort, int limit) Deprecated.since 3.8.1 with no direct replacement.searchTestRuns
(String query, String sort, int resultLimit) Searches for Test Runs matching the query.searchTestRunTemplates
(String query, String sort, int resultLimit) Searches for Test Run templates matching the query.void
setTestSteps
(IWorkItem testCase, ITestSteps testSteps) Returns the project level test parameter library.Creates a builder for the processing of test failures into tracked defects.
-
Field Details
-
DO_NOT_USE_LIGHTWEIGHT_TESTRUN
Deprecated.Since 3.10.3, seegetLightweightTestRun(String, String)
.- See Also:
-
-
Method Details
-
createOrFindTestCaseWorkItem
Finds a Work Item in the specified project with the type specified byTestsConfiguration.getTestCaseWorkItemType()
that has the same value in the custom field specified byTestsConfiguration.getTestCaseIdCustomField()
as thetestCaseId
parameter. When there is no such Work Item, then the method creates a new Work Item and sets the value of thetestCaseId
parameter to the above mentioned custom field.- Parameters:
projectId
- The id of the project that the Work Item should be searched/created in.testCaseId
- The id of the test case, for example from an xUnit file, not the ID of the Work Item.template
- When null, then the template defined in configuration is used.- Returns:
- never returns null or an unresolvable Work Item.
- See Also:
-
isAutomatedTestCase
Checks if the given Work Item was created by thecreateOrFindTestCaseWorkItem(String, String, IWorkItem)
method by checking if it has a populated custom field that is fille-in by thecreateOrFindTestCaseWorkItem(String, String, IWorkItem)
method. -
createTestsFileProcessor
Creates a tests file processor.- Parameters:
projectId
- The project where the test run will be created.id
- The id of the processor.- Returns:
- returns null when a processor with the given id does not exist.
- See Also:
-
getTestRun
Returns a Test Run from the specified project with the specified id.- Parameters:
projectId
-id
-- Returns:
- never returns null, but the returned Test Run might be unresolvable.
-
getTestRun
@NotNull ITestRun getTestRun(@NotNull String projectId, @NotNull String id, @Nullable String revision) Returns a Test Run from the specified project with the specified id and revision.- Parameters:
projectId
-id
-revision
- - The Test Run's revision. Ifnull
then the head revision.- Returns:
- never returns null, but the returned Test Run might be unresolvable.
- Since:
- 3.10.0
-
getLightweightTestRun
Deprecated.Since 3.10.3, now equivalent togetTestRun(String, String)
. The system propertyDO_NOT_USE_LIGHTWEIGHT_TESTRUN
no longer has an effect. -
createTestRun
@NotNull ITestRun createTestRun(@NotNull String projectId, @NotNull String id, @Nullable String templateId) Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template.IPObject.save()
must be called on the returned object after the caller has finished setting the fields.- Parameters:
projectId
-id
- Is ignored when the generated id functionality is turned on.templateId
- The id of the Test Run template. Can be null.
-
createTestRun
@NotNull ITestRun createTestRun(@NotNull String projectId, @Nullable String id, @Nullable String templateId, boolean asTemplate) Creates an unsaved Test Run in the specified project with the specified id and initializes it from the specified template.IPObject.save()
must be called on the returned object after the caller is finished setting the fields.- Parameters:
projectId
-id
- Is ignored when the generated id functionality is turned on. Id can benull
only if generated id functionality is enabled.templateId
- The id of the Test Run template. Can be null.asTemplate
-- Since:
- 3.9.1
-
searchTestRuns
Searches for Test Runs matching the query.- Parameters:
query
-sort
- the format is same as forIIndexSearch.sort(String)
.resultLimit
- The maximum size of the returned list. A negative number means that there is no limit.- Returns:
- a
IPObjectList
containing the result of the query. - See Also:
-
searchTestRunTemplates
Searches for Test Run templates matching the query.- Parameters:
query
-sort
- the format is same as forIIndexSearch.sort(String)
resultLimit
- The maximum size of the returned list. A negative number means that there is no limit.- Returns:
- a
IPObjectList
containing the result of the query. - See Also:
-
searchTestRecords
Deprecated.since 3.8.1 with no direct replacement. -
getLastTestRecords
Returns the latest Test Records by execution time for the test case. (The most recent are first.)- Parameters:
testCase
-count
- How many of the latest Test Records should be returned. Must be greater than zero.
-
createTestResultsImportJobUnit
ITestResultsImportJobUnit createTestResultsImportJobUnit() -
getRunningTestResultsImportJobUnit
Finds the Test Run's currently running, but incomplete, Test Results import job. Returnsnull
if no such job is running.- Parameters:
testRun
-- Returns:
- job unit or
null
-
isConfigurationDefined
- Parameters:
projectId
- The project id, ornull
for the global configuration.- Returns:
- true if a test configuration is defined.
-
getConfiguration
Returns the test configuration that also contains the genericTestRunsConfiguration
. UsegetTestRunsConfiguration(String, String)
to get the type-specific Test Runs configuration.- Parameters:
projectId
- The project id, ornull
for the global configuration.
-
getTestCaseFailureConfiguration
@NotNull TestCaseFailureConfiguration getTestCaseFailureConfiguration(@Nullable String projectId, @Nullable String testRunTypeId, @Nullable String testCaseTypeId) Returns the testing configuration for the given test case Work Item type.- Parameters:
projectId
- The Project ID, ornull
for the global configuration.testRunTypeId
- The Test Run type ID, ornull
for the generic configuration.testCaseTypeId
- The test case Work Item type ID, ornull
for the generic configuration.- Since:
- 3.24.10
-
saveConfiguration
Saves the test's configuration and the contained genericTestRunsConfiguration
andTestCaseFailureConfiguration
.- Parameters:
projectId
- The project id, ornull
for the global configuration.configuration
-
-
getTestRunsConfiguration
@NotNull TestRunsConfiguration getTestRunsConfiguration(@Nullable String projectId, @Nullable String typeId) Returns the Test Run configuration for the given Test Run type.- Parameters:
projectId
- The project id, ornull
for the global configuration.typeId
- The Test Run type id, ornull
for the generic configuration.- Since:
- 3.10.1
-
getTestRecordResultEnum
- Returns:
- configured enumeration for
ITestRecord.KEY_RESULT
-
getTestRunTypeEnum
- Returns:
- configured enumeration for
IWorkflowObject.KEY_TYPE
-
getTestRunStatusEnum
- Returns:
- configured enumeration for
IWorkflowObject.KEY_TYPE
-
getConfiguredDefectToTestCaseLinkRole
@Deprecated(since="3.24.10", forRemoval=true) @Nullable ILinkRoleOpt getConfiguredDefectToTestCaseLinkRole(@Nullable String projectId) Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- configured enumeration for
ILinkedWorkItemStruct.KEY_ROLE
of the link from defect to test case
-
getConfiguredDefectToTestCaseLinkRole
@Nullable ILinkRoleOpt getConfiguredDefectToTestCaseLinkRole(@Nullable String projectId, @Nullable String typeId) - Parameters:
typeId
- The test case Work Item type ID, ornull
for the generic configuration.- Returns:
- configured enumeration for
ILinkedWorkItemStruct.KEY_ROLE
of the link from defect to test case - Since:
- 3.24.10
-
getPolicy
ITestManagementPolicy getPolicy() -
getTestSteps
- Since:
- 3.6.3
-
setTestSteps
- Since:
- 3.6.3
-
getTestStepsCustomField
- Since:
- 3.6.3
-
getTestStepsCustomField
- Since:
- 3.6.3
-
getTestStepsKeys
Returns the default Test Step keys for all Work Item types.- Since:
- 3.6.3
-
getTestStepsKeys
@NotNull List<ITestStepKeyOpt> getTestStepsKeys(@Nullable String projectId, @Nullable String wiType) Returns Test Step keys for a specific Work Item type.- Since:
- 3.23.10
-
deleteTestRuns
Deletes the Test Runs specified in the input set.- Parameters:
testRuns
- A set of Test Runs to be deleted. Does not acceptnull
- Since:
- 3.8.1
-
testParametersLibrary
Returns the project level test parameter library. The global library is not supported, so usingIScopeSelector.global()
orIScopeSelector.forProject(String)
with a null value returns an empty library.- Since:
- 3.9.2
-
trackDefectByRules
Creates a builder for the processing of test failures into tracked defects.- Since:
- 3.17.3
-
getLightweightTestRun(String, String)
.