ilog.rules.teamserver.model.testing
Class IlrTestingHelper
- java.lang.Object
-
- ilog.rules.teamserver.model.testing.IlrTestingHelper
-
public class IlrTestingHelper extends java.lang.Object
Contains methods to manipulate the IlrTestSuite and IlrTestReport models.
-
-
Field Summary
Fields Modifier and Type Field and Description static com.google.common.collect.Ordering<IlrTestReport>
TestReportOrderingByDate
-
Constructor Summary
Constructors Constructor and Description IlrTestingHelper()
-
Method Summary
Methods Modifier and Type Method and Description static boolean
canTakeLock(IlrSession session, IlrElementHandle elt)
static IlrElementDetails
commitToTargetBaseline(ilog.rules.teamserver.model.IlrSessionEx session, IlrBaseline targetBaseline, IlrCommitableObject co)
static void
deleteTestReports(IlrSession session, java.util.List<java.lang.String> testReportIds)
Deletes the list of test reports of the given test report IDs.static void
deleteTestSuite(IlrSession session, java.util.List<java.lang.String> testSuiteIds)
Deletes the test suite of the given test suite ID.static java.util.List<IlrTestReport>
filterTestReportForBaseline(java.util.List<IlrTestReport> unfiltered, IlrSession session, IlrBaseline baseline)
static <T extends IlrBaseline>
TgetBaselineForThisId(IlrSession session, java.lang.String baselineId)
static java.util.List<IlrSnapshot>
getBranchSnapshots(IlrSession session, IlrBaseline baseline)
static java.lang.String
getDefaultTestReportPrefix(IlrSession session)
static java.lang.String
getDefaultTestReportPrefix(IlrSession session, IlrBaseline baseline, java.lang.String operationName, com.ibm.icu.text.DateFormat format)
static java.lang.String
getDefaultTestSuiteName(IlrSession session)
static java.lang.String
getDefaultTestSuiteName(IlrSession session, IlrBaseline baseline, java.lang.String operationName, com.ibm.icu.text.DateFormat format)
static java.util.List<IlrServer>
getDefinedServers(IlrProjectInfo projectInfo)
Gets the list of servers available to run test suites defined for the specified project.static java.util.List<IlrServer>
getDefinedServers(IlrSession session)
Gets the list of RES servers defined on the decision server.static java.util.List<IlrServer>
getDefinedServers(IlrSession session, IlrServerKind serverKind)
static IlrExtractor
getExtractor(IlrSession session, IlrOperation operation)
Gets the extractor of the test suite.static com.ibm.icu.text.DateFormat
getFilenameDateTimeFormat()
static IlrReportOperationInfo
getReportOperationInfo(IlrSession session, IlrTestReport testReport)
static IlrReportTestSuiteInfo
getReportTestSuiteInfo(IlrSession session, IlrTestReport testReport)
static java.lang.String
getRuleFlowEntryPoint(IlrSession session, IlrBaseline baseline, IlrOperation operation)
Gets the ruleflow name of the operation.static java.lang.Object
getScenarioDefaultFilename(IlrSession session)
static java.lang.Object
getScenarioDefaultFilename(IlrSession session, com.ibm.icu.text.DateFormat format)
static IlrServerKind
getSupportedServerKind(IlrProjectInfo projectInfo)
Returns the kind of server that can be used to run test suites for the specified project.static IlrTestCaseResource
getTestCaseResource(IlrSession session, java.lang.String testSuiteId, java.lang.String resourceKey)
Gets the scenario file of the given test suite.static IlrTestCaseResource
getTestCaseResource(IlrTestSuite testSuite)
Gets the definition file of the test suite.static java.lang.Object
getTestingLock()
static IlrTestReport
getTestReportForThisId(IlrSession session, java.lang.String testReportId)
static java.lang.String
getTestReportName(IlrSession session, java.lang.String reportName)
static <T> java.util.List<T>
getTestReports(IlrSession session, IlrBaseline baseline, boolean handle)
static IlrTestSuite
getTestSuiteForThisId(IlrSession session, java.lang.String testSuiteId)
static IlrTestSuite
getTestSuiteLatestVersion(IlrSession session, IlrBaseline baseline, java.lang.String testSuiteId)
static java.util.List<IlrTestReport>
getTestSuiteReports(IlrSession session, IlrTestSuite testSuite)
Gets the list of test reports of the given test suite.static <T> java.util.List<T>
getTestSuites(IlrSession session, IlrBaseline baseline, boolean handle)
static <T> java.util.List<T>
getTestSuites(IlrSession session, IlrBaseline targetBaseline, IlrBaseline baseline, boolean handle)
Gets the list of test suites in the target baseline, including those in the baselines of dependent projects.static IlrTestReport
jobIdToElementDetails(IlrSession session, java.lang.String jobId)
Gets the test report element for the given job ID.static IlrTestReport
runOneTestSuite(IlrBaseline baseline, IlrTestSuite testSuite)
Runs a test suite.
-
-
-
Field Detail
-
TestReportOrderingByDate
public static final com.google.common.collect.Ordering<IlrTestReport> TestReportOrderingByDate
-
-
Method Detail
-
getTestingLock
public static java.lang.Object getTestingLock()
-
getBaselineForThisId
public static <T extends IlrBaseline> T getBaselineForThisId(IlrSession session, java.lang.String baselineId) throws IlrApplicationException
- Throws:
IlrApplicationException
-
canTakeLock
public static boolean canTakeLock(IlrSession session, IlrElementHandle elt) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestCaseResource
public static IlrTestCaseResource getTestCaseResource(IlrSession session, java.lang.String testSuiteId, java.lang.String resourceKey) throws IlrApplicationException
Gets the scenario file of the given test suite.- Throws:
IlrApplicationException
- Parameters:
session
- The session.testSuiteId
- The test suite ID.resourceKey
- The definition file name.- Returns:
- The test case object.
-
getTestSuites
public static <T> java.util.List<T> getTestSuites(IlrSession session, IlrBaseline targetBaseline, IlrBaseline baseline, boolean handle) throws IlrApplicationException
Gets the list of test suites in the target baseline, including those in the baselines of dependent projects. Test suites already exist in the baseline or busy are removed from the list.- Throws:
IlrApplicationException
- Returns:
- All data required to populate the test suite grid.
-
getTestSuites
public static <T> java.util.List<T> getTestSuites(IlrSession session, IlrBaseline baseline, boolean handle) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestReportForThisId
public static IlrTestReport getTestReportForThisId(IlrSession session, java.lang.String testReportId) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestSuiteForThisId
public static IlrTestSuite getTestSuiteForThisId(IlrSession session, java.lang.String testSuiteId) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestSuiteLatestVersion
public static IlrTestSuite getTestSuiteLatestVersion(IlrSession session, IlrBaseline baseline, java.lang.String testSuiteId) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestReports
public static <T> java.util.List<T> getTestReports(IlrSession session, IlrBaseline baseline, boolean handle) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestSuiteReports
public static java.util.List<IlrTestReport> getTestSuiteReports(IlrSession session, IlrTestSuite testSuite) throws IlrApplicationException
Gets the list of test reports of the given test suite.- Throws:
IlrApplicationException
- Parameters:
session
- The session.testSuite
- The test suite.- Returns:
- The list of test reports.
-
deleteTestSuite
public static void deleteTestSuite(IlrSession session, java.util.List<java.lang.String> testSuiteIds) throws IlrApplicationException
Deletes the test suite of the given test suite ID.- Throws:
IlrApplicationException
- Parameters:
session
- The session.testSuiteIds
- The test suite ID.
-
deleteTestReports
public static void deleteTestReports(IlrSession session, java.util.List<java.lang.String> testReportIds) throws IlrApplicationException
Deletes the list of test reports of the given test report IDs.- Throws:
IlrApplicationException
- Parameters:
session
- The session.testReportIds
- The list of test report IDs.
-
runOneTestSuite
public static IlrTestReport runOneTestSuite(IlrBaseline baseline, IlrTestSuite testSuite) throws IlrApplicationException
Runs a test suite.- Throws:
IlrApplicationException
- Parameters:
testSuite
- The test suite to run.- Returns:
- The job ID.
-
getDefinedServers
public static java.util.List<IlrServer> getDefinedServers(IlrSession session) throws IlrApplicationException
Gets the list of RES servers defined on the decision server.- Throws:
IlrApplicationException
- Parameters:
session
- The session.- Returns:
- The list of RES servers.
-
getDefinedServers
public static java.util.List<IlrServer> getDefinedServers(IlrSession session, IlrServerKind serverKind) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getDefinedServers
public static java.util.List<IlrServer> getDefinedServers(IlrProjectInfo projectInfo) throws IlrApplicationException
Gets the list of servers available to run test suites defined for the specified project. Depending on the context (ex: use of Decision engine), the returned servers can point to RES or Decision Runner URLs.- Throws:
IlrApplicationException
- Parameters:
projectInfo
- The project information.- Returns:
- the list of applicable servers.
-
getSupportedServerKind
public static IlrServerKind getSupportedServerKind(IlrProjectInfo projectInfo)
Returns the kind of server that can be used to run test suites for the specified project.- Parameters:
projectInfo
- The project information.- Returns:
IlrServerKind.DECISION_RUNNER_LITERAL
if the Decision Runner can be used, orIlrServerKind.RES_LITERAL
if the SSP must be used.
-
getBranchSnapshots
public static java.util.List<IlrSnapshot> getBranchSnapshots(IlrSession session, IlrBaseline baseline) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getTestCaseResource
public static IlrTestCaseResource getTestCaseResource(IlrTestSuite testSuite) throws IlrObjectNotFoundException
Gets the definition file of the test suite.- Throws:
IlrObjectNotFoundException
- Parameters:
testSuite
- The test suite.- Returns:
- The test definition file.
-
jobIdToElementDetails
public static IlrTestReport jobIdToElementDetails(IlrSession session, java.lang.String jobId) throws IlrApplicationException
Gets the test report element for the given job ID.- Throws:
IlrApplicationException
- Parameters:
session
- The session.jobId
- The execution job ID.- Returns:
- The test report.
-
getExtractor
public static IlrExtractor getExtractor(IlrSession session, IlrOperation operation) throws IlrApplicationException
Gets the extractor of the test suite.- Throws:
ilog.rules.teamserver.model.IlrTestingException
IlrObjectNotFoundException
IlrApplicationException
- Parameters:
session
- The session.operation
- The operation.- Returns:
- The extractor.
-
getRuleFlowEntryPoint
public static java.lang.String getRuleFlowEntryPoint(IlrSession session, IlrBaseline baseline, IlrOperation operation) throws IlrApplicationException
Gets the ruleflow name of the operation.- Throws:
IlrApplicationException
- Parameters:
session
- The session.operation
- The operation where the ruleflow is located.- Returns:
- The ruleflow name.
-
commitToTargetBaseline
public static IlrElementDetails commitToTargetBaseline(ilog.rules.teamserver.model.IlrSessionEx session, IlrBaseline targetBaseline, IlrCommitableObject co) throws IlrApplicationException
- Throws:
IlrApplicationException
-
filterTestReportForBaseline
public static java.util.List<IlrTestReport> filterTestReportForBaseline(java.util.List<IlrTestReport> unfiltered, IlrSession session, IlrBaseline baseline)
-
getDefaultTestSuiteName
public static java.lang.String getDefaultTestSuiteName(IlrSession session)
-
getDefaultTestReportPrefix
public static java.lang.String getDefaultTestReportPrefix(IlrSession session)
-
getTestReportName
public static java.lang.String getTestReportName(IlrSession session, java.lang.String reportName)
-
getScenarioDefaultFilename
public static java.lang.Object getScenarioDefaultFilename(IlrSession session)
-
getDefaultTestSuiteName
public static java.lang.String getDefaultTestSuiteName(IlrSession session, IlrBaseline baseline, java.lang.String operationName, com.ibm.icu.text.DateFormat format)
-
getDefaultTestReportPrefix
public static java.lang.String getDefaultTestReportPrefix(IlrSession session, IlrBaseline baseline, java.lang.String operationName, com.ibm.icu.text.DateFormat format)
-
getScenarioDefaultFilename
public static java.lang.Object getScenarioDefaultFilename(IlrSession session, com.ibm.icu.text.DateFormat format)
-
getFilenameDateTimeFormat
public static com.ibm.icu.text.DateFormat getFilenameDateTimeFormat()
-
getReportOperationInfo
public static IlrReportOperationInfo getReportOperationInfo(IlrSession session, IlrTestReport testReport) throws IlrApplicationException
- Throws:
IlrApplicationException
-
getReportTestSuiteInfo
public static IlrReportTestSuiteInfo getReportTestSuiteInfo(IlrSession session, IlrTestReport testReport) throws IlrApplicationException
- Throws:
IlrApplicationException
-
-