Package org.azd.test

Class TestApi

java.lang.Object
org.azd.test.TestApi
All Implemented Interfaces:
TestDetails

public class TestApi extends Object implements TestDetails
  • Constructor Details

    • TestApi

      public TestApi(Connection connection)
      Pass the connection object to work with Service hooks Api
      Parameters:
      connection - Connection object
  • Method Details

    • createTestRun

      public TestRun createTestRun(RunCreateModel runCreateModel) throws AzDException
      Create new test run.
      Specified by:
      createTestRun in interface TestDetails
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRunById

      public TestRun getTestRunById(int runId) throws AzDException
      Get a test run by its ID.
      Specified by:
      getTestRunById in interface TestDetails
      Parameters:
      runId - ID of the run to get.
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRuns

      public TestRuns getTestRuns() throws AzDException
      Get a list of test runs.
      Specified by:
      getTestRuns in interface TestDetails
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRuns

      public TestRuns getTestRuns(int top) throws AzDException
      Get a list of test runs.
      Specified by:
      getTestRuns in interface TestDetails
      Parameters:
      top - Number of test runs to return.
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRuns

      public TestRuns getTestRuns(String buildUri) throws AzDException
      Get a list of test runs.
      Specified by:
      getTestRuns in interface TestDetails
      Parameters:
      buildUri - URI of the build that the runs used.
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRuns

      public TestRuns getTestRuns(int skip, int top, boolean automated, String buildUri, boolean includeRunDetails, String owner, int planId, String tmiRunId) throws AzDException
      Get a list of test runs.
      Specified by:
      getTestRuns in interface TestDetails
      Parameters:
      skip - Number of test runs to skip.
      top - Number of test runs to return.
      automated - If true, only returns automated runs.
      buildUri - URI of the build that the runs used.
      includeRunDetails - If true, include all the properties of the runs.
      owner - Team foundation ID of the owner of the runs.
      planId - ID of the test plan that the runs are a part of.
      tmiRunId - None
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api Exception handler.
    • getTestRunStatistics

      public TestRunStatistic getTestRunStatistics(int runId) throws AzDException
      Get test run statistics , used when we want to get summary of a run by outcome.
      Specified by:
      getTestRunStatistics in interface TestDetails
      Parameters:
      runId - ID of the run to get.
      Returns:
      TestRunStatistic Object TestRunStatistic
      Throws:
      AzDException - Default Api Exception handler.
    • deleteTestRun

      public Void deleteTestRun(int runId) throws AzDException
      Delete a test run by its ID.
      Specified by:
      deleteTestRun in interface TestDetails
      Parameters:
      runId - ID of the run to delete.
      Throws:
      AzDException - Default Api Exception handler.
    • queryTestRuns

      public TestRuns queryTestRuns(String maxLastUpdatedDate, String minLastUpdatedDate) throws AzDException
      Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
      Specified by:
      queryTestRuns in interface TestDetails
      Parameters:
      maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
      minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
      Returns:
      TestRuns Object TestRuns
      Throws:
      AzDException - Default Api Exception handler.
    • queryTestRuns

      public TestRuns queryTestRuns(String maxLastUpdatedDate, String minLastUpdatedDate, int top) throws AzDException
      Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
      Specified by:
      queryTestRuns in interface TestDetails
      Parameters:
      maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
      minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
      top - Number of runs to be queried. Limit is 100.
      Returns:
      TestRuns Object TestRuns
      Throws:
      AzDException - Default Api Exception handler.
    • queryTestRuns

      public TestRuns queryTestRuns(String maxLastUpdatedDate, String minLastUpdatedDate, String[] buildIds) throws AzDException
      Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
      Specified by:
      queryTestRuns in interface TestDetails
      Parameters:
      maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
      minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
      buildIds - Build Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      Returns:
      TestRuns Object TestRuns
      Throws:
      AzDException - Default Api Exception handler.
    • queryTestRuns

      public TestRuns queryTestRuns(String maxLastUpdatedDate, String minLastUpdatedDate, TestRunState testRunState) throws AzDException
      Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
      Specified by:
      queryTestRuns in interface TestDetails
      Parameters:
      maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
      minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
      testRunState - Current state of the Runs to be queried.
      Returns:
      TestRuns Object TestRuns
      Throws:
      AzDException - Default Api Exception handler.
    • queryTestRuns

      public TestRuns queryTestRuns(String maxLastUpdatedDate, String minLastUpdatedDate, String branchName, String[] buildDefIds, String continuationToken, boolean isAutomated, String[] planIds, TestRunPublishContext publishContext, String[] releaseDefIds, String[] releaseEnvDefIds, String[] releaseEnvIds, String[] releaseIds, String runTitle) throws AzDException
      Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
      Specified by:
      queryTestRuns in interface TestDetails
      Parameters:
      maxLastUpdatedDate - Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
      minLastUpdatedDate - Minimum Last Modified Date of run to be queried (Mandatory).
      branchName - Source Branch name of the Runs to be queried.
      buildDefIds - Build Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      continuationToken - continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user.
      isAutomated - Automation type of the Runs to be queried.
      planIds - Plan Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      publishContext - PublishContext of the Runs to be queried.
      releaseDefIds - Release Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      releaseEnvDefIds - Release Environment Definition Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      releaseEnvIds - Release Environment Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      releaseIds - Release Ids of the Runs to be queried, comma separated list of valid ids (limit no. of ids 10).
      runTitle - Run Title of the Runs to be queried.
      Returns:
      TestRuns Object TestRuns
      Throws:
      AzDException - Default Api Exception handler.
    • updateTestRun

      public TestRun updateTestRun(int runId, TestRun testRun) throws AzDException
      Update test run by its ID.
      Specified by:
      updateTestRun in interface TestDetails
      Parameters:
      runId - ID of the run to update.
      testRun - TestRun object.
      Returns:
      TestRun Object TestRun
      Throws:
      AzDException - Default Api exception handler.