public class HALMTestReporterCommon extends Object
| Constructor and Description |
|---|
HALMTestReporterCommon()
Initializes a Logger for the class calling this.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
determineOS(Platform p)
Determines the OS with the supplied Platform enum.
|
FormValidation |
doAutomationSuiteIDValidation(String value)
Checks if an automation suite has been selected.
|
ListBoxModel |
doFillAutomationSuiteIDItems(String halmConnectionID,
String projectID)
Populates the Automation Suite dropdown based on the selected connection and project.
|
ListBoxModel |
doFillHalmConnectionIDItems()
Populates the 'credentialType' dropdown with appropriate values.
|
ListBoxModel |
doFillProjectIDItems(String halmConnectionID)
Populates the 'projectID' dropdown based on the selection of the connectionID dropdown.
|
ListBoxModel |
doFillTestFileFormatItems()
Populates the Test File Format dropdown.
|
ListBoxModel |
doFillTestRunSetIDItems(String halmConnectionID,
String projectID)
Populates the Test Run Set dropdown.
|
FormValidation |
doHalmConnectionIDValidation(String value)
Checks the validity of the current connection.
|
FormValidation |
doProjectIDValidation(String value)
Checks if a Helix ALM project has been selected.
|
static com.perforce.halm.rest.ConnectionInfo |
getConnectionInfo(HALMConnection connection)
Gets the connection info from a selected connection.
|
static com.cloudbees.plugins.credentials.common.StandardCredentials |
getCredentialsFromConnection(HALMConnection connection)
Retrieves the credentials based on the Helix ALM connection
|
static com.cloudbees.plugins.credentials.common.StandardCredentials |
getCredentialsFromId(String credentialsID)
Retrieves the credentials based on a credential ID
|
static String |
getExceptionForLogging(Exception ex)
Converts the exception into a stack trace we can log.
|
String |
getIDOfAutomationSuite(String name,
String connID,
String projID)
Gets the id (or key) of the first automation suite with the given name, or null if nothing exists
|
String |
getIDOfTestRunSet(String name,
String connID,
String projID)
Gets the id (or key) of the first test run set with the given name, or null if nothing exists
|
String |
getLabelOfAutomationSuite(long id)
Gets the label (or name) of an automation suite given its ID, or null if nothing exists.
|
static String |
getLabelOfTestRunSet(long id)
Gets the label of a test run set given its ID, or null if nothing exists.
|
static com.perforce.halm.reportingtool.format.ReportFormatType |
getTypeFromOrdinal(String ord)
From the ordinal expressed as a string, get the ReportFormatType enum with that ordinal.
|
void |
logFromCaller(String message)
Writes a message to log from its caller.
|
void |
setLastProjectID(String projectID) |
void |
submitBuildToHelixALM(Run<?,?> run,
FilePath workspace,
EnvVars env,
Launcher launcher,
TaskListener listener,
HALMTestReporterObject reportObj)
Common function to submit test results to Helix ALM.
|
public HALMTestReporterCommon()
public static String getExceptionForLogging(Exception ex)
ex - Exception we want to logpublic void setLastProjectID(String projectID)
public FormValidation doHalmConnectionIDValidation(String value)
public FormValidation doProjectIDValidation(String value)
public FormValidation doAutomationSuiteIDValidation(String value)
public ListBoxModel doFillHalmConnectionIDItems()
public ListBoxModel doFillProjectIDItems(String halmConnectionID)
halmConnectionID - Currently selected halmConnectionIDpublic ListBoxModel doFillAutomationSuiteIDItems(String halmConnectionID, String projectID)
halmConnectionID - Currently selected HALM Connection UUIDprojectID - Currently selected HALM Project UUIDpublic ListBoxModel doFillTestFileFormatItems()
public ListBoxModel doFillTestRunSetIDItems(String halmConnectionID, String projectID)
halmConnectionID - Currently selected HALM Connection UUIDprojectID - Currently selected HALM Project UUIDpublic static com.cloudbees.plugins.credentials.common.StandardCredentials getCredentialsFromId(String credentialsID)
credentialsID - Jenkins credentials IDpublic static com.cloudbees.plugins.credentials.common.StandardCredentials getCredentialsFromConnection(@NotNull
HALMConnection connection)
connection - Helix ALM connectionpublic static com.perforce.halm.reportingtool.format.ReportFormatType getTypeFromOrdinal(String ord)
ord - - the ordinal as it is in the list box.public static String determineOS(Platform p)
p - - the Platform from the environment, will be WINDOWS or UNIXpublic static com.perforce.halm.rest.ConnectionInfo getConnectionInfo(@NotNull
HALMConnection connection)
throws Exception
connection - - the selected HALMConnectionException - if anything fails.public String getLabelOfAutomationSuite(long id)
id - - The id of the automation suite returned from the REST API.public static String getLabelOfTestRunSet(long id)
id - - the id of the test run set returned from the REST API.public String getIDOfAutomationSuite(String name, String connID, String projID)
name - - The name of the automation suite returned from the REST API.connID - - the connection IDprojID - - the Helix ALM project IDpublic String getIDOfTestRunSet(String name, String connID, String projID)
name - - The name of the automation suite returned from the REST API.connID - - the connection IDprojID - - the Helix ALM project IDpublic void logFromCaller(String message)
message - - The message to write to log.public void submitBuildToHelixALM(@NotNull
Run<?,?> run,
FilePath workspace,
EnvVars env,
Launcher launcher,
TaskListener listener,
HALMTestReporterObject reportObj)
throws Exception
run - - The Jenkins build that called this function.workspace - - The workspace generated by the build. If null,
default to the first "root" of the jenkins server.env - - The environment that the build runs with.launcher - - The launcher object generated by a build.listener - - the logger for the run object. If null, write to this object's log instead.reportObj - - The report object, supplied by the caller.Exception - - if anything goes wrong aside from what is expected, return the function to the caller.Copyright © 2016–2022. All rights reserved.