public class ExecutionPlanningService
extends java.lang.Object
Example:
// STEP 1: The execution planning Web Service is one of several Web Services offered by Silk Central, and you need to use
// some of the other Web Services as well to successfully implement execution calls, for example for authentication.
//
// The first step is to get the service from the locator as shown below (the URL must be adapted to your environment).
adminService = new AdministrationServiceService(new URL("http://localhost:19120/services/jaxws/administration")).getAdministrationServicePort();
testsService = new TestsServiceService(new URL("http://localhost:19120/services/jaxws/tests")).getTestsServicePort();
executionPlanningService = new ExecutionPlanningServiceService(new URL("http://localhost:19120/services/jaxws/executionplanning")).getExecutionPlanningServicePort();
// STEP 2: You must login to Silk Central with valid user credentials to use any Web Service methods.
// To login, use an existing Silk Central user account.
sessionId = executionPlanningService.logonUser("admin", "admin");
// STEP 3: Before you can create nodes in the execution tree, you need to specify the following:
// You must define the project you want to work with. Use the adminService Web Service to get a project.
// You need a root node (ID). The root node of the execution tree can be obtained from the project.
// Each execution plan must be assigned to a test container of the planning tree, thus you need to get
// an existing test container node ID by using the planning Web Service.
projects = adminService.findProjects(sessionId, PROJECT_NAME);
ExecutionNode root = executionPlanningService.getExecutionRootNode(sessionId, projects.get(0).getId());
NamedEntity testContainer = testsService.getTestContainers(sessionId, projects.get(0).getId()).get(0);
// STEP 4: Now you are ready to create nodes and add them to the execution tree. A node in the execution tree is of the type
// "ExecutionNode". Define whether you want to add a "Folder" or an "Execution Plan" node by setting the "kind"
// parameter accordingly (2 = folder, 3 = execution plan) - make sure that the root node still exists.
int nodeId = executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewFolder("Folder1", "first folder"), root.getId());
executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewExecutionNode("ExecDef1.1", "child execDef", BUILD, VERSION, testContainer.getId()), nodeId);
nodeId = executionPlanningService.addNode(sessionId, projects.get(0).getId(), getNewExecutionNode("ExecDef1", "first execDef", BUILD, VERSION, testContainer.getId()), root.getId());
// STEP 5: Assign test definitions to the execution plan.
// Use the planning Web Service to get the planning nodes.
// Create a comma-separated list with the IDs of the planning nodes and assign them to the execution node.
ExecutionNode execNode = mExecutionPlannningService.getNode(getSessionId(), nodeId);
String testIds = ...
for (PropertyValue prop : execNode.getPropertyValues()) {
if ("PROP_ASSIGNED_TESTDEFS".equals(prop.getPropertyID())) {
prop.setValue(testIds);
}
}
mExecutionPlannningService.updateNode(getSessionId(), nodeId);
// STEP 6: Assign attributes to the execution plan.
// Create a list of property values, each property containing one attribute.
// Use the execution planning Web Service to get the execution node and assign the list of property values to the execution node.
List<PropertyValue> properties = new ArrayList<>();
// - Release attribute
PropertyValue release = new PropertyValue();
release.setPropertyTypeId("_attribute_");
release.setPropertyId("_attribute_Release");
release.setValue("Release 2009");
release.setType(11); // type normal, see PropertyMetaInfo for property value types
properties.add(release);
// - Sprint attribute
PropertyValue sprint = new PropertyValue();
sprint.setPropertyTypeId("_attribute_");
sprint.setPropertyId("_attribute_Sprint");
sprint.setValue("Sprint 8");
sprint.setType(11);
properties.add(sprint);
ExecutionNode node = executionPlanningService.getNode(sessionId, nodeId);
node.getPropertyValues().addAll(properties);
executionPlanningService.updateNode(getSessionId(), node);
| Constructor and Description |
|---|
ExecutionPlanningService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeOptions(java.lang.String sessionId,
int projectId,
java.lang.String attributeName,
AttributeOption[] options)
Adds attribute options to the given attribute identified by attributeName.
|
ProjectAttribute[] |
addAttributes(java.lang.String sessionId,
int projectId,
ProjectAttribute[] attributes)
Adds attributes to the given project identified by projectId (this allows specifying min/max/precision values when adding numeric attributes).
|
int |
addNode(java.lang.String sessionId,
int projectId,
ExecutionNode node,
int parentId)
Adds a node to the execution tree.
|
void |
deleteAttributeOptions(java.lang.String sessionId,
int projectId,
java.lang.String attributeName,
AttributeOption[] options)
Deletes attribute options of the given attribute identified by attributeName.
|
void |
deleteAttributes(java.lang.String sessionId,
int projectId,
ProjectAttribute[] attributes)
Deletes the attributes identified by their IDs for the given project identified by projectId.
|
void |
deleteNode(java.lang.String sessionId,
int nodeId)
Deletes a node and all its children from the execution tree.
|
ManualTester[] |
getAssignedManualTesters(java.lang.String sessionId,
int execDefId)
Retrieve assigned manual testers of an execution plan.
|
ProjectAttribute[] |
getAttributes(java.lang.String sessionId,
int projectId)
Returns all attributes for the given project identified by projectId.
|
ExecutionNode[] |
getChildNodes(java.lang.String sessionId,
int parentNodeId)
Gets the child nodes of a parent node in the execution tree.
|
int |
getCleanupTestDefinition(java.lang.String sessionId,
int execNodeId)
Gets the ID of the test that is used for cleanup in an execution plan or in a configuration suite.
|
ExecutionResult |
getExecutionResult(java.lang.String sessionId,
ExecutionHandle handle)
Returns results on a per-execution plan basis.
Note: The execution must be finished to get a result, otherwise the return value will be null. |
java.lang.String |
getExecutionResultURL(java.lang.String sessionId,
int executionDefId,
long executionTimestamp,
java.lang.String execServerHostName,
int execServerPort)
Returns a URL that can be used to access the results of a specific run on a browser.
|
ExecutionNode |
getExecutionRootNode(java.lang.String sessionId,
int projectId)
Searches for the root node in the execution tree.
|
java.lang.String[] |
getKeywords(java.lang.String sessionId,
int execNodeId)
Retrieves all keywords of an execution plan.
|
ManualTester[] |
getManualTesters(java.lang.String sessionId,
int projectId)
Retrieve a list of manual testers available for this project.
|
ExecutionNode |
getNode(java.lang.String sessionId,
int nodeId)
Gets the node, specified with the nodeId, from the execution tree.
|
ExecutionNode[] |
getNodes(java.lang.String sessionId,
int projectId,
java.lang.String name)
Gets an array of
ExecutionNodes, specified with the name of the node. |
NodeParameter[] |
getParameters(java.lang.String sessionId,
int execNodeId)
Retrieve all parameters of an execution plan.
|
java.lang.String[] |
getPropertyIds(java.lang.String sessionId,
int kind)
Gets a list of all valid properties of a node in the execution tree.
|
PropertyMetaInfo |
getPropertyInfo(java.lang.String sessionId,
int kind,
java.lang.String id)
Retrieves the
PropertyMetaInfo for a property of a node. |
int |
getSetupTestDefinition(java.lang.String sessionId,
int execNodeId)
Gets the ID of the test that is used for setup in an execution plan or in a configuration suite.
|
int |
getStateOfExecution(java.lang.String sessionId,
ExecutionHandle handle)
Gets the state of an already started execution.
|
java.lang.String |
logonUser(java.lang.String username,
java.lang.String plainPwd)
Logs on with a given username and password.
|
void |
setAssignedManualTesters(java.lang.String sessionId,
int execDefId,
int[] manualTesterIds)
Assigns manual testers to an execution plan.
|
void |
setCleanupTestDefinition(java.lang.String sessionId,
int execNodeId,
int testDefId)
Sets the ID of the test that will be used for cleanup in an execution plan or in a configuration suite.
|
void |
setKeywords(java.lang.String sessionId,
int execNodeId,
java.lang.String[] keywords)
Sets keywords for an execution plan.
|
void |
setParameter(java.lang.String sessionId,
int execNodeId,
java.lang.String parameterName,
java.lang.String parameterValue)
Sets a parameter for an execution plan.
|
void |
setSetupTestDefinition(java.lang.String sessionId,
int execNodeId,
int testDefId)
Sets the ID of the test that is used for setup in an execution plan or in a configuration suite.
|
ExecutionHandle[] |
startExecution(java.lang.String sessionId,
int nodeId)
Executes the specified node (folder, configuration suite or execution plan).
|
ExecutionHandle[] |
startExecutionWithOptions(java.lang.String sessionId,
int nodeId,
java.lang.String build,
int option,
java.lang.String sinceBuild)
Executes the specified node (folder, configuration suite or execution plan).
|
ExecutionHandle[] |
startExecutionWithOptionsInternal(java.lang.String sessionId,
int nodeId,
java.lang.String build,
int option,
java.lang.String sinceBuild,
java.util.Map<java.lang.String,com.segue.tm.common.execution.parameters.ParameterData> parameters,
java.lang.String sourceControlBranch) |
ProjectAttribute[] |
updateAttributes(java.lang.String sessionId,
int projectId,
ProjectAttribute[] attributes)
Updates given attributes identified by their IDs for the given project identified by projectId.
|
void |
updateNode(java.lang.String sessionId,
ExecutionNode node)
Updates an existing node in the execution tree.
|
public java.lang.String logonUser(java.lang.String username,
java.lang.String plainPwd)
throws WSFaultException
username - the login usernameplainPwd - the password of the specified usernameWSFaultException - if logon failspublic PropertyMetaInfo getPropertyInfo(java.lang.String sessionId, int kind, java.lang.String id) throws WSFaultException
PropertyMetaInfo for a property of a node. Properties are used to describe the execution node in more detail. (e.g. name, node type,
description... are all properties).sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)kind - a number for which can interpreted as the following:id - The property ID. Use the getPropertyIds(java.lang.String, int) method to get a list of valid IDs for a property.WSFaultExceptionpublic void setSetupTestDefinition(java.lang.String sessionId,
int execNodeId,
int testDefId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution plan or the configuration suitetestDefId - the unique ID of the setup testWSFaultExceptionpublic int getSetupTestDefinition(java.lang.String sessionId,
int execNodeId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution plan or the configuration suiteWSFaultExceptionpublic void setCleanupTestDefinition(java.lang.String sessionId,
int execNodeId,
int testDefId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution plan or the configuration suitetestDefId - the unique ID of the cleanup testWSFaultExceptionpublic int getCleanupTestDefinition(java.lang.String sessionId,
int execNodeId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution plan or the configuration suiteWSFaultExceptionpublic int addNode(java.lang.String sessionId,
int projectId,
ExecutionNode node,
int parentId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project where to add the nodenode - Value object of the node. See class ExecutionNode.parentId - Parent node ID.WSFaultExceptionpublic ExecutionNode getNode(java.lang.String sessionId, int nodeId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)nodeId - ID of the node.ExecutionNode. If no node is found a WSFaultException will be thrown.WSFaultExceptionpublic ExecutionNode[] getNodes(java.lang.String sessionId, int projectId, java.lang.String name) throws WSFaultException
ExecutionNodes, specified with the name of the node. Use the '%' as a wildcard character for searching with a fragment of the
node name. Example: The call getNodes(sessionId, 0, "Silk%") will return all execution nodes of which the name starts with
'Silk'.sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project from where you want to get the nodesname - Name of the node in the execution treeExecutionNode or an empty array if no nodes are found.WSFaultExceptionpublic void updateNode(java.lang.String sessionId,
ExecutionNode node)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)node - Value object of the node. See class ExecutionNode.WSFaultExceptionpublic void deleteNode(java.lang.String sessionId,
int nodeId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)nodeId - ID of the node.WSFaultExceptionpublic ExecutionNode[] getChildNodes(java.lang.String sessionId, int parentNodeId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)parentNodeId - The ID of the parent node for which you want to fetch the child nodes.ExecutionNode). An ExecutionNode can be a folder, a configuration suite or an execution plan.WSFaultExceptionpublic java.lang.String[] getPropertyIds(java.lang.String sessionId,
int kind)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)kind - a number for which can interpreted as the following:WSFaultExceptionpublic ExecutionNode getExecutionRootNode(java.lang.String sessionId, int projectId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - The ID of the project of which you want to retrieve the root node.ExecutionNode) of the execution tree.WSFaultExceptionpublic int getStateOfExecution(java.lang.String sessionId,
ExecutionHandle handle)
throws WSFaultException
ExecutionHandle is returned by
startExecution(String, int).sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)handle - the ExecutionHandle returned by startExecution(String, int) or startExecutionWithOptions(String, int, String, int, String)WSFaultException - if an error occurred. An error message briefly explains the cause of the error. For detailed information, refer to the front-end server log
files.public ExecutionResult getExecutionResult(java.lang.String sessionId, ExecutionHandle handle) throws WSFaultException
null.sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)handle - the ExecutionHandle returned by startExecution(String, int) or startExecutionWithOptions(String, int, String, int, String)ExecutionResultWSFaultException - if an error occurred. An error message briefly explains the cause of the error. For detailed information, refer to the front-end server log
files.public ExecutionHandle[] startExecutionWithOptions(java.lang.String sessionId, int nodeId, java.lang.String build, int option, java.lang.String sinceBuild) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)nodeId - the ID of an execution tree nodebuild - Optional: The name of the build to set for the started run. If the build does not exist and the started node is an execution plan it will be created.option - controls, which tests currently assigned to the execution plan are executed.
sinceBuild - build number since which tests have not been executed. Specify this parameter for option options 3 and 4.ExecutionHandle to identify the started executionWSFaultException - if an error occurred. An error message briefly explains the cause of the error. For detailed information, refer to the front-end server log
files.public ExecutionHandle[] startExecutionWithOptionsInternal(java.lang.String sessionId, int nodeId, java.lang.String build, int option, java.lang.String sinceBuild, java.util.Map<java.lang.String,com.segue.tm.common.execution.parameters.ParameterData> parameters, java.lang.String sourceControlBranch) throws WSFaultException, com.segue.scc.util.localizer.LocalizableException
WSFaultExceptioncom.segue.scc.util.localizer.LocalizableExceptionpublic ExecutionHandle[] startExecution(java.lang.String sessionId, int nodeId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)nodeId - the ID of an execution tree nodeExecutionHandle to identify the started executionWSFaultException - if an error occurred. An error message briefly explains the cause of the error. For detailed information, refer to the front-end server log
files.public ManualTester[] getManualTesters(java.lang.String sessionId, int projectId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the project ID for which the possible testers should be queriedManualTester objectsWSFaultExceptionpublic void setAssignedManualTesters(java.lang.String sessionId,
int execDefId,
int[] manualTesterIds)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execDefId - the unique ID of the execution planmanualTesterIds - WSFaultExceptionpublic ManualTester[] getAssignedManualTesters(java.lang.String sessionId, int execDefId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execDefId - the unique ID of the execution planWSFaultExceptionpublic void setParameter(java.lang.String sessionId,
int execNodeId,
java.lang.String parameterName,
java.lang.String parameterValue)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution planparameterName - parameterValue - WSFaultExceptionpublic NodeParameter[] getParameters(java.lang.String sessionId, int execNodeId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution planWSFaultExceptionpublic void setKeywords(java.lang.String sessionId,
int execNodeId,
java.lang.String[] keywords)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution plankeywords - WSFaultExceptionpublic java.lang.String[] getKeywords(java.lang.String sessionId,
int execNodeId)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)execNodeId - the unique ID of the execution planWSFaultExceptionpublic java.lang.String getExecutionResultURL(java.lang.String sessionId,
int executionDefId,
long executionTimestamp,
java.lang.String execServerHostName,
int execServerPort)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)executionDefId - an execution plan ID identifying the execution run together with executionTimestampexecutionTimestamp - a timestamp identifying the execution run together with executionDefIdexecServerHostName - not used anymore - run is identified by executionDefId and executionTimestampexecServerPort - not used anymore - run is identified by executionDefId and executionTimestampWSFaultExceptionpublic ProjectAttribute[] getAttributes(java.lang.String sessionId, int projectId) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attributes should be retrievedWSFaultExceptionpublic ProjectAttribute[] addAttributes(java.lang.String sessionId, int projectId, ProjectAttribute[] attributes) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attributes should be addedattributes - an array of Attribute objects that should be addedWSFaultExceptionpublic ProjectAttribute[] updateAttributes(java.lang.String sessionId, int projectId, ProjectAttribute[] attributes) throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attributes should be updatedattributes - an array of Attribute objects that need to be updatedWSFaultExceptionpublic void deleteAttributes(java.lang.String sessionId,
int projectId,
ProjectAttribute[] attributes)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attributes should be deletedattributes - an array of attribute objects which should be deletedWSFaultExceptionpublic void addAttributeOptions(java.lang.String sessionId,
int projectId,
java.lang.String attributeName,
AttributeOption[] options)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attribute options should be addedattributeName - the name of the attribute for which the attribute option should be addedoptions - an array of attribute options which should be added to the attributeWSFaultExceptionpublic void deleteAttributeOptions(java.lang.String sessionId,
int projectId,
java.lang.String attributeName,
AttributeOption[] options)
throws WSFaultException
sessionId - the web-service token, generated in the Silk Central UI, or the unique ID of the session created with logonUser(String, String)projectId - the ID of the project for which the attribute options should be deletedattributeName - the name of the attribute for which the attribute option should be deletedoptions - an array of attribute options which should be deleted from the attributeWSFaultExceptionCopyright © Micro Focus 2004-2019. All rights reserved.