org.aludratest.hpalm.impl
Class DefaultTestCaseIdResolver

java.lang.Object
  extended by org.aludratest.hpalm.impl.DefaultTestCaseIdResolver
All Implemented Interfaces:
TestCaseIdResolver

public class DefaultTestCaseIdResolver
extends Object
implements TestCaseIdResolver

Default implementation of the TestCaseIdResolver service interface. This default implementation tries to determine the HP ALM test ID for a given test case with the following algorithm:

  1. First, it tries to load a Java class with the name of the parent RunnerGroup of the given RunnerLeaf.
  2. If such a class could be loaded, it is scanned for an Annotation of type HpAlmTestId.
  3. If such an annotation is present, its value is taken as HP ALM test ID.
  4. If this way was not successful, the name of the parent RunnerGroup is scanned for the pattern ID_nnnnnn_, where nnnnnn must be numerical and consist of one to six digits. If such a pattern is found, the numerical value is returned.
  5. If all these steps were unsuccessful, null is returned, causing the test case not to be logged to HP ALM.

Author:
falbrech

Field Summary
 
Fields inherited from interface org.aludratest.hpalm.TestCaseIdResolver
ROLE
 
Constructor Summary
DefaultTestCaseIdResolver()
           
 
Method Summary
 Long getHpAlmTestConfigId(org.aludratest.scheduler.node.RunnerLeaf testCase)
          Returns the HP ALM Configuration ID to use for the given runner leaf.
 Long getHpAlmTestId(org.aludratest.scheduler.node.RunnerLeaf testCase)
          Returns the HP ALM test ID to assign the given runner leaf to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTestCaseIdResolver

public DefaultTestCaseIdResolver()
Method Detail

getHpAlmTestId

public Long getHpAlmTestId(org.aludratest.scheduler.node.RunnerLeaf testCase)
Description copied from interface: TestCaseIdResolver
Returns the HP ALM test ID to assign the given runner leaf to. A return value of null indicates that such an ID could not be determined. In this case, a warning is logged, and the test case execution is not logged to HP ALM.

Specified by:
getHpAlmTestId in interface TestCaseIdResolver
Parameters:
testCase - Runner leaf representing the test case execution.
Returns:
The HP ALM test ID to assign the test case execution to, or null if no ID could be determined.

getHpAlmTestConfigId

public Long getHpAlmTestConfigId(org.aludratest.scheduler.node.RunnerLeaf testCase)
Description copied from interface: TestCaseIdResolver
Returns the HP ALM Configuration ID to use for the given runner leaf. Unlike TestCaseIdResolver.getHpAlmTestId(RunnerLeaf), a null return value does not skip the logging for this leaf, but assigns the run result to the whole test instead of a test configuration.

Specified by:
getHpAlmTestConfigId in interface TestCaseIdResolver
Parameters:
testCase - Runner leaf representing the test case execution.
Returns:
The HP ALM configuration ID to assign the given runner leaf to, or null to assign it to the test.


Copyright © 2015 aludratest.org. All rights reserved.