Class TestResult

java.lang.Object
fi.meliora.testlab.ext.rest.model.ModelObject
fi.meliora.testlab.ext.rest.model.TestResult
All Implemented Interfaces:
Serializable

public class TestResult extends ModelObject
Encapsulates inbound results of a single test run.
Author:
Marko Kanala
See Also:
  • Field Details

  • Constructor Details

    • TestResult

      public TestResult()
  • Method Details

    • getProjectId

      public Long getProjectId()
    • setProjectId

      public void setProjectId(Long projectId)
      Id of the project to add the test results to. If null, projectKey is used.
      Parameters:
      projectId - projectId
    • getProjectKey

      public String getProjectKey()
    • setProjectKey

      public void setProjectKey(String projectKey)
      Key of the project to add the test results to. Optional if projectId is set.
      Parameters:
      projectKey - project prefix / key
    • getRuleset

      public String getRuleset()
    • setRuleset

      public void setRuleset(String ruleset)
      Name of the ruleset to apply to these results. Test result rulesets are configured in the "Test automation" UI in Testlab. If not set, a default ruleset for the project is used.
      Parameters:
      ruleset - name of the ruleset
    • getTestRunId

      public Long getTestRunId()
    • setTestRunId

      public void setTestRunId(Long testRunId)
      Id of the test run to update the test results to. If null, testRunTitle is used.
      Parameters:
      testRunId - test run id
    • getTestRunTitle

      public String getTestRunTitle()
    • setTestRunTitle

      public void setTestRunTitle(String testRunTitle)
      Title of the test run to update the test results to. Optional if testRunId is set.
      Parameters:
      testRunTitle - test run title
    • setAutomationSourceId

      public void setAutomationSourceId(Long automationSourceId)
    • getAutomationSourceId

      public Long getAutomationSourceId()
    • setAutomationSourceTitle

      public void setAutomationSourceTitle(String automationSourceTitle)
      Parameters:
      automationSourceTitle - Source of test results
    • getAutomationSourceTitle

      public String getAutomationSourceTitle()
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
      Description for the test run. If test run exists and description is left as null the description of TestRun at Testlab is left as it is.
      Parameters:
      description - comment
    • getUser

      public String getUser()
    • setUser

      public void setUser(String user)
      Name of the user to execute Testlab operations with.
      Parameters:
      user - user name
    • getMilestoneId

      public Long getMilestoneId()
    • setMilestoneId

      public void setMilestoneId(Long milestoneId)
      Id of the milestone for the test run and issues. If null, milestoneIdentifier and milestoneTitle are used.
      Parameters:
      milestoneId - milestone id
    • getMilestoneIdentifier

      public String getMilestoneIdentifier()
    • setMilestoneIdentifier

      public void setMilestoneIdentifier(String milestoneIdentifier)
      Identifier of the milestone for the test run and issues. If null, milestoneTitle is used.
      Parameters:
      milestoneIdentifier - milestone identifier
    • getMilestoneTitle

      public String getMilestoneTitle()
    • setMilestoneTitle

      public void setMilestoneTitle(String milestoneTitle)
      Title of the milestone for the test run and issues.
      Parameters:
      milestoneTitle - milestone title
    • getTestTargetId

      public Long getTestTargetId()
    • setTestTargetId

      public void setTestTargetId(Long testTargetId)
      Id of the test target (version) for the test run. If null, testTargetTitle is used.
      Parameters:
      testTargetId - test target id
    • getTestTargetTitle

      public String getTestTargetTitle()
    • setTestTargetTitle

      public void setTestTargetTitle(String testTargetTitle)
      Title of the test target (version) for the test run. Optional if testTargetId is set.
      Parameters:
      testTargetTitle - test target title
    • getTestEnvironmentId

      public Long getTestEnvironmentId()
    • setTestEnvironmentId

      public void setTestEnvironmentId(Long testEnvironmentId)
      Id of the test environment for the test run. If null, testEnvironmentTitle is used.
      Parameters:
      testEnvironmentId - test environment id
    • getTestEnvironmentTitle

      public String getTestEnvironmentTitle()
    • setTestEnvironmentTitle

      public void setTestEnvironmentTitle(String testEnvironmentTitle)
      Title of the test environment for the test run. Optional if testEnvironmentId is set.
      Parameters:
      testEnvironmentTitle - test environment title
    • getTags

      public String getTags()
    • setTags

      public void setTags(String tags)
      Tags for the test run. Optional. Separate multiple tags with spaces ("tag1 tag2 tag3 ...").
      Parameters:
      tags - a list of tags
    • getTestCaseMappingField

      @Deprecated public String getTestCaseMappingField()
      Deprecated.
    • setTestCaseMappingField

      @Deprecated public void setTestCaseMappingField(String testCaseMappingField)
      Deprecated.
      Title of the custom field to use to map the test cases from the project. Optional if results are sent with actual testCaseId values set. This value is case-insensitive.
      Parameters:
      testCaseMappingField - test case mapping field
    • getResults

      public List<TestCaseResult> getResults()
    • getParameters

      public List<KeyValuePair> getParameters()
      Values to set to test case parameters if any.
      Returns:
      parameters
    • setParameters

      public void setParameters(List<KeyValuePair> parameters)
    • setResults

      public void setResults(List<TestCaseResult> results)
      Results of individual test cases.
      Parameters:
      results - results
    • getAddIssueStrategy

      public TestResult.AddIssueStrategy getAddIssueStrategy()
    • setAddIssueStrategy

      public void setAddIssueStrategy(TestResult.AddIssueStrategy addIssueStrategy)
      When to add issues for failed results. Never, one issue per test run, one issue per Testlab test case, or one issue per test result
      Parameters:
      addIssueStrategy - TestResult.AddIssueStrategy
    • getReopenExistingIssues

      public Boolean getReopenExistingIssues()
    • setReopenExistingIssues

      public void setReopenExistingIssues(Boolean reopenExistingIssues)
      Set to true to reopen existing issues in Testlab if found.
      Parameters:
      reopenExistingIssues - Boolean
    • getAssignIssuesToUser

      public String getAssignIssuesToUser()
    • setAssignIssuesToUser

      public void setAssignIssuesToUser(String assignIssuesToUser)
      Assign added issues to this user if the user is found in the project.
      Parameters:
      assignIssuesToUser - boolean
    • getXml

      public String getXml()
    • setXml

      public void setXml(String xml)
      JUnit compatible xml content for results. If results are delivered in results field this field is ignored.
      Parameters:
      xml - xml
    • isImportTestCases

      @Deprecated public Boolean isImportTestCases()
      Deprecated.
    • setImportTestCases

      @Deprecated public void setImportTestCases(Boolean importTestCases)
      Deprecated.
      If set implies that test cases which are not found via the mapping identifier should be automatically created during the push.
      Parameters:
      importTestCases - boolean
    • getImportTestCasesRootCategory

      @Deprecated public String getImportTestCasesRootCategory()
      Deprecated.
    • setImportTestCasesRootCategory

      @Deprecated public void setImportTestCasesRootCategory(String importTestCasesRootCategory)
      Deprecated.
      If set, sets the root category path where the test cases are created. By default, "Import".
      Parameters:
      importTestCasesRootCategory - boolean
    • getXmlFormat

      public String getXmlFormat()
    • setXmlFormat

      public void setXmlFormat(String xmlFormat)
      Format for provided xml file. "junit" | "robot" - defaults to "junit".
      Parameters:
      xmlFormat - format
    • isRobotCatenateParentKeywords

      public Boolean isRobotCatenateParentKeywords()
    • setRobotCatenateParentKeywords

      public void setRobotCatenateParentKeywords(Boolean robotCatenateParentKeywords)
      If true, when the xml provided is in Robot Framework format and in the xml keyword has sub keywords, the sub keywords are catenated to a single step in the result. For example, if the robot result has
      <pre> <kw name="Open site"> <kw name="Open URL"> <kw name="Navigate browser"> ... </kw> </kw> </kw> ... </pre>
      .. the test case is added with a single step described as "Open site - Open URL - Navigate browser". When concatenating, if a step fails it is always included as a step.
      If false, each sub keyword will generate a separate step to the result.
      This value defaults to true.
      Parameters:
      robotCatenateParentKeywords - boolean
    • getResultName

      public String getResultName()
    • setResultName

      public void setResultName(String resultName)
      Optional. If set, this will be used as a name for the results (file) added to Testlab. For example, this can be set as an URL (for example Jenkins job URL) or the name of the result file you are pushing the results from.
      Parameters:
      resultName - result name
    • getCulprits

      public List<String> getCulprits()
    • setCulprits

      public void setCulprits(List<String> culprits)
      Culprits for the possible failure, if any.
      Parameters:
      culprits - culprits
    • getChangesets

      public List<Changeset> getChangesets()
    • setChangesets

      public void setChangesets(List<Changeset> changesets)
      Changesets the test result relates to. For Testlab to react to these values, the VCS integration to be set up for the project for the Changeset to exist in the Testlab's database. If corresponding Changeset does not exist in Testlab, these values are ignored.
      Parameters:
      changesets - changesets