Package mks.ci.server.engine
Class LocalTriggerManager.ScriptTestResultDeltaBean
- java.lang.Object
-
- mks.frame.triggers.ScriptExposableBaseBean
-
- mks.frame.triggers.beans.ScriptBaseBean
-
- mks.ci.server.engine.LocalTriggerManager.ScriptIMBaseBean
-
- mks.ci.server.engine.LocalTriggerManager.ScriptTestResultBean
-
- mks.ci.server.engine.LocalTriggerManager.ScriptTestResultDeltaBean
-
- All Implemented Interfaces:
mks.frame.triggers.ScriptExposableBean
- Enclosing class:
- LocalTriggerManager
public static class LocalTriggerManager.ScriptTestResultDeltaBean extends LocalTriggerManager.ScriptTestResultBean
A bean that encapsulates a single test result. All information on the test result is available regardless of what operation was invoked.
Instances of this bean are available through the
getTestResultBeans
call of theScriptTestResultsArgsBean
during a create, or edit test result operation. All information on the test result is available to this bean. Test result metadata, if available, is exposed for update on this bean via thesetFieldValue
methods.This bean provides read-write access.
-
-
Constructor Summary
Constructors Constructor Description ScriptTestResultDeltaBean(mks.ci.server.engine.TestResult original, mks.ci.server.engine.TestResult delta, int userId, java.sql.Connection c, boolean readonly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToAddAttachments(java.lang.String name, java.lang.String summary, java.lang.String file, java.lang.String contentType)
Add an attachment to this test result.void
addToAddRelatedItems(int relatedItem)
Add an item to the "add related item" list.void
addToRemoveAttachments(java.lang.String name)
Remove an attachment from this test result.void
addToRemoveRelatedItems(int relatedItem)
Add an item to the "remove related item" list.LocalTriggerManager.ScriptAttachmentBean[]
getAddAttachmentBeans()
Return all attachments that are going to be added to this test result, as an array of ScriptAttachmentBeans.java.lang.String[]
getAddAttachments()
Return all names of attachments that are going to be added to this test result, as an array of Strings.LocalTriggerManager.ScriptIssueBean[]
getAddRelatedItemBeans()
Returns all items that are going to be related to this test result as an array of ScriptIssueBeans.int[]
getAddRelatedItems()
Returns all items that are going to be related to this test result as an array of Windchill RV&S item ids.java.lang.String
getExposedName()
Returns the name of this bean that is exposed to the scripting language.java.lang.String
getNewAnnotation()
Gets the new annotation of this test result.java.lang.String
getNewFieldDisplayString(java.lang.String fieldName)
Retrieve the new value of a result field as a printable string.java.lang.Object
getNewFieldValue(java.lang.String fieldName)
Retrieve the new value of the test result field by name.LocalTriggerManager.ScriptTestStepResultBean[]
getNewStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the current test step results of this test result, or null if there are no test step results.java.lang.String
getNewVerdict()
Returns the name of the verdict set for this test result, or null if no verdict has been set.LocalTriggerManager.ScriptTestVerdictBean
getNewVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the new verdict for this test result, or null if no verdict had been set.java.lang.String
getNewVerdictType()
Returns the name of the verdict type set for this test result (e.g.LocalTriggerManager.ScriptVerdictTypeBean
getNewVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the verdict type set for this test result, or null if no verdict has been set.java.lang.String
getOldAnnotation()
Gets the original annotation of this test result.java.lang.String
getOldFieldDisplayString(java.lang.String fieldName)
Retrieve the original value of a result field as a printable string.java.lang.Object
getOldFieldValue(java.lang.String fieldName)
Retrieve the old value of the test result field by name.LocalTriggerManager.ScriptTestStepResultBean[]
getOldStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the original test step results of this test result, or null if there are no test step results.java.lang.String
getOldVerdict()
Returns the name of the original verdict for this test result, or null if no verdict has been set.LocalTriggerManager.ScriptTestVerdictBean
getOldVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the original verdict for this test result, or null if no verdict had been set.java.lang.String
getOldVerdictType()
Returns the name of the original verdict type for this test result (e.g.LocalTriggerManager.ScriptVerdictTypeBean
getOldVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the original verdict type for this test result, or null if no verdict has been set.LocalTriggerManager.ScriptAttachmentBean[]
getRemoveAttachmentBeans()
Return all attachments that are going to be added to this test result, as an array of ScriptAttachmentBeans.java.lang.String[]
getRemoveAttachments()
Return all names of attachments that are going to be removed from this test result, as an array of Strings.LocalTriggerManager.ScriptIssueBean[]
getRemoveRelatedItemBeans()
Returns all items that are no longer going to be related to this test result as an array of ScriptIssueBeans.int[]
getRemoveRelatedItems()
Returns all items that are no longer going to be related to this test result as an array of Windchill RV&S item ids.LocalTriggerManager.ScriptTestStepResultBean[]
getRemoveStepResultBeans()
Returns all test step results that have been removed from this test result.boolean
hasAddAttachments()
Return true if attachments will be added to this test result.boolean
hasAddRelatedItems()
Return true if relationships are going to be added to this test result.boolean
hasRemoveAttachments()
Return true if this test result has attachments that will be removed.boolean
hasRemoveRelatedItems()
Return true if relationships are going to be removed from this test result.boolean
isAddAttachment(java.lang.String attachment)
Return true if the given attachment name represents an attachment that will be added to this test result.boolean
isAddRelatedItem(int relatedItem)
Return true if the given item is in the add related item list of this test result.boolean
isRemoveAttachment(java.lang.String attachment)
Return true if the given attachment name represents an attachment that will be removed from this test result.boolean
isRemoveRelatedItem(int relatedItem)
Return true if the given item is in the remove related item list of this test result.void
removeFromAddAttachments(java.lang.String name)
Remove an attachment from the "add attachments" list.void
removeFromAddRelatedItems(int relatedItem)
Remove an item from the "add related item" list.void
removeFromRemoveAttachments(java.lang.String name)
Remove an attachment from the list of attachments that are to be removed from this test result.void
removeFromRemoveRelatedItems(int relatedItem)
Remove an item from the "remove related item" list.void
setAnnotation(java.lang.String annotation)
Sets the annotation of this test result.void
setFieldValue(java.lang.String fieldName, double value)
Change the value of a result field by name.void
setFieldValue(java.lang.String fieldName, java.lang.String value)
Change the value of a result field by name.void
setFieldValue(java.lang.String fieldName, java.util.Date value)
Change the value of a result field by name.void
setVerdict(java.lang.String verdict)
Sets the verdict of this test result.-
Methods inherited from class mks.ci.server.engine.LocalTriggerManager.ScriptTestResultBean
getAnnotation, getAttachmentBeans, getAttachments, getCaseBean, getCaseID, getFieldDisplayString, getFieldValue, getRelatedItemBeans, getRelatedItems, getSessionBean, getSessionID, getSharesCaseBean, getSharesCaseID, getStepResultBeans, getVerdict, getVerdictBean, getVerdictType, getVerdictTypeBean, hasAttachments, hasRelatedItems, hasStepResults, hasVerdict, isRelatedItem
-
Methods inherited from class mks.ci.server.engine.LocalTriggerManager.ScriptIMBaseBean
getCurrentDatabaseTime, getCurrentDatabaseTime, getCurrentUser, getServerBean, getUserID, isParallelProcessingEnabled
-
Methods inherited from class mks.frame.triggers.beans.ScriptBaseBean
getEnvironmentBean, setEnvironmentBean
-
-
-
-
Method Detail
-
getExposedName
public java.lang.String getExposedName()
Description copied from class:ScriptBaseBean
Returns the name of this bean that is exposed to the scripting language.- Specified by:
getExposedName
in interfacemks.frame.triggers.ScriptExposableBean
- Overrides:
getExposedName
in classLocalTriggerManager.ScriptTestResultBean
- Returns:
- the bean name:
siMemberBean
.
-
getOldVerdict
public java.lang.String getOldVerdict()
Returns the name of the original verdict for this test result, or null if no verdict has been set.- Returns:
- A string representing the verdict, or null if no verdict has been set.
-
getNewVerdict
public java.lang.String getNewVerdict()
Returns the name of the verdict set for this test result, or null if no verdict has been set. If the value is unchanged, the old verdict name is retrieved.- Returns:
- A string representing the verdict, or null if no verdict has been set.
-
getOldVerdictBean
public LocalTriggerManager.ScriptTestVerdictBean getOldVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the original verdict for this test result, or null if no verdict had been set.- Returns:
- A
LocalTriggerManager.ScriptTestVerdictBean
, or null if no verdict is set.
-
getNewVerdictBean
public LocalTriggerManager.ScriptTestVerdictBean getNewVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the new verdict for this test result, or null if no verdict had been set. If the value is unchanged, the old verdict is retrieved.- Returns:
- A
LocalTriggerManager.ScriptTestVerdictBean
, or null if no verdict is set.
-
getOldVerdictType
public java.lang.String getOldVerdictType()
Returns the name of the original verdict type for this test result (e.g. "Pass", "Fail", "Other") or null if no verdict has been set.- Returns:
- A string representing the verdict type, or null if no verdict has been set.
-
getNewVerdictType
public java.lang.String getNewVerdictType()
Returns the name of the verdict type set for this test result (e.g. "Pass", "Fail", "Other") or null if no verdict has been set. If the value is unchanged, the old verdict type is retrieved.- Returns:
- A string representing the verdict type, or null if no verdict has been set.
-
getOldVerdictTypeBean
public LocalTriggerManager.ScriptVerdictTypeBean getOldVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the original verdict type for this test result, or null if no verdict has been set.- Returns:
- A
LocalTriggerManager.ScriptVerdictTypeBean
, or null if no verdict has been set.
-
getNewVerdictTypeBean
public LocalTriggerManager.ScriptVerdictTypeBean getNewVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the verdict type set for this test result, or null if no verdict has been set. If the value is unchanged, the old verdict type is retrieved.- Returns:
- A
LocalTriggerManager.ScriptVerdictTypeBean
, or null if no verdict has been set.
-
getOldAnnotation
public java.lang.String getOldAnnotation()
Gets the original annotation of this test result.- Returns:
- The annotation of this test result.
-
getNewAnnotation
public java.lang.String getNewAnnotation()
Gets the new annotation of this test result. If the value is unchanged, the old annotation is retrieved.- Returns:
- The annotation of this test result.
-
getOldStepResultBeans
public LocalTriggerManager.ScriptTestStepResultBean[] getOldStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the original test step results of this test result, or null if there are no test step results.- Returns:
- an array of
LocalTriggerManager.ScriptTestStepResultBean
.
-
getNewStepResultBeans
public LocalTriggerManager.ScriptTestStepResultBean[] getNewStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the current test step results of this test result, or null if there are no test step results. If the value is unchanged, the old test steps are retrieved. The array may contain eitherLocalTriggerManager.ScriptTestStepResultDeltaBean
in the case where the test step had been changed in the test result orLocalTriggerManager.ScriptTestStepResultBean
where no change has been made.- Returns:
- an array of
LocalTriggerManager.ScriptTestStepResultBean
.
-
getRemoveStepResultBeans
public LocalTriggerManager.ScriptTestStepResultBean[] getRemoveStepResultBeans() throws mks.frame.triggers.TriggerException
Returns all test step results that have been removed from this test result.- Returns:
- an array of beans representing test step results that have been removed from this test result.
- Throws:
mks.frame.triggers.TriggerException
-
setVerdict
public void setVerdict(java.lang.String verdict) throws mks.frame.triggers.TriggerException
Sets the verdict of this test result.- Parameters:
verdict
- The new verdict to set for this test result.- Throws:
mks.frame.triggers.TriggerException
- if the verdict does not exist, or if the script is running in a POST trigger context.
-
setAnnotation
public void setAnnotation(java.lang.String annotation) throws mks.frame.triggers.TriggerException
Sets the annotation of this test result.- Parameters:
annotation
- the new annotation to set for this test result.- Throws:
mks.frame.triggers.TriggerException
- if the script is running in a POST trigger context.
-
hasAddRelatedItems
public boolean hasAddRelatedItems()
Return true if relationships are going to be added to this test result.- Returns:
- true if relationships are going to be added to this test result, false otherwise.
-
isAddRelatedItem
public boolean isAddRelatedItem(int relatedItem)
Return true if the given item is in the add related item list of this test result.- Parameters:
relatedItem
- the item to check- Returns:
- true if the given item is in the add related item list of this test result, false otherwise.
-
getAddRelatedItems
public int[] getAddRelatedItems()
Returns all items that are going to be related to this test result as an array of Windchill RV&S item ids.- Returns:
- an array of Windchill RV&S item ids.
-
getAddRelatedItemBeans
public LocalTriggerManager.ScriptIssueBean[] getAddRelatedItemBeans() throws mks.frame.triggers.TriggerException
Returns all items that are going to be related to this test result as an array of ScriptIssueBeans.- Returns:
- an array of beans representing Windchill RV&S items that are to be related to this test result.
- Throws:
mks.frame.triggers.TriggerException
-
addToAddRelatedItems
public void addToAddRelatedItems(int relatedItem) throws mks.frame.triggers.TriggerException
Add an item to the "add related item" list. Any item added to this list will be related to this test result.- Parameters:
relatedItem
- The item to create a relationship with.- Throws:
mks.frame.triggers.TriggerException
- if:- The item to add is already in the list of add related items
- The item to add is already related to this test result
- The script is running in a POST trigger context
-
removeFromAddRelatedItems
public void removeFromAddRelatedItems(int relatedItem) throws mks.frame.triggers.TriggerException
Remove an item from the "add related item" list. Any item removed from this list will not be related to this test result.- Parameters:
relatedItem
- The item to remove from the "add related item" list.- Throws:
mks.frame.triggers.TriggerException
- if:- The item to remove from the add related items list does not exist in that list.
- The script is running in a POST trigger context
-
hasRemoveRelatedItems
public boolean hasRemoveRelatedItems()
Return true if relationships are going to be removed from this test result.- Returns:
- true if relationships are going to be removed from this test result, false otherwise.
-
isRemoveRelatedItem
public boolean isRemoveRelatedItem(int relatedItem)
Return true if the given item is in the remove related item list of this test result.- Parameters:
relatedItem
- the item to check- Returns:
- true if the given item is in the remove related item list of this test result, false otherwise.
-
getRemoveRelatedItems
public int[] getRemoveRelatedItems()
Returns all items that are no longer going to be related to this test result as an array of Windchill RV&S item ids.- Returns:
- an array of Windchill RV&S item ids.
-
getRemoveRelatedItemBeans
public LocalTriggerManager.ScriptIssueBean[] getRemoveRelatedItemBeans() throws mks.frame.triggers.TriggerException
Returns all items that are no longer going to be related to this test result as an array of ScriptIssueBeans.- Returns:
- an array of beans representing Windchill RV&S items that will no longer be related to this test result.
- Throws:
mks.frame.triggers.TriggerException
-
addToRemoveRelatedItems
public void addToRemoveRelatedItems(int relatedItem) throws mks.frame.triggers.TriggerException
Add an item to the "remove related item" list. Any item added to this list will no longer be related to this test result.- Parameters:
relatedItem
- the item to remove a relationship from.- Throws:
mks.frame.triggers.TriggerException
- if:- The item to add is already in the list of remove related items
- The item to add is not related to this test result
- The script is running in a POST trigger context
-
removeFromRemoveRelatedItems
public void removeFromRemoveRelatedItems(int relatedItem) throws mks.frame.triggers.TriggerException
Remove an item from the "remove related item" list. Any item removed from this list will continue to be related to this test result.- Parameters:
relatedItem
- The item to remove from the "add related item" list.- Throws:
mks.frame.triggers.TriggerException
- if:- The item to remove from the remove related items list does not exist in that list.
- The script is running in a POST trigger context
-
hasAddAttachments
public boolean hasAddAttachments()
Return true if attachments will be added to this test result.- Returns:
- true if attachments will be added to this test result, false otherwise.
-
isAddAttachment
public boolean isAddAttachment(java.lang.String attachment)
Return true if the given attachment name represents an attachment that will be added to this test result.- Parameters:
attachment
- The name of the attachment- Returns:
- true if the given attachment name represents an attachment that will be added to this test result.
-
getAddAttachments
public java.lang.String[] getAddAttachments()
Return all names of attachments that are going to be added to this test result, as an array of Strings.- Returns:
- an array of attachment names
-
getAddAttachmentBeans
public LocalTriggerManager.ScriptAttachmentBean[] getAddAttachmentBeans()
Return all attachments that are going to be added to this test result, as an array of ScriptAttachmentBeans.- Returns:
- An array of beans representing test result attachments.
-
addToAddAttachments
public void addToAddAttachments(java.lang.String name, java.lang.String summary, java.lang.String file, java.lang.String contentType) throws mks.frame.triggers.TriggerException
Add an attachment to this test result.- Parameters:
name
- The name of the attachmentsummary
- The summary of the attachmentfile
- The path to the file on the server filesystemcontentType
- The content type (can be null)- Throws:
mks.frame.triggers.TriggerException
- if:- an attachment by this name has already been added to this test result.
- the script is running in a POST trigger context
-
removeFromAddAttachments
public void removeFromAddAttachments(java.lang.String name) throws mks.frame.triggers.TriggerException
Remove an attachment from the "add attachments" list.- Parameters:
name
- The attachment name to remove.- Throws:
mks.frame.triggers.TriggerException
- if:- the attachment is not in the add attachment list.
- the script is running in a POST trigger context
-
hasRemoveAttachments
public boolean hasRemoveAttachments()
Return true if this test result has attachments that will be removed.- Returns:
- true if this test result has attachments that will be removed, false otherwise.
-
isRemoveAttachment
public boolean isRemoveAttachment(java.lang.String attachment)
Return true if the given attachment name represents an attachment that will be removed from this test result.- Parameters:
attachment
- The name of the attachment- Returns:
- true if the given attachment name represents an attachment that will be removed from this test result.
-
getRemoveAttachments
public java.lang.String[] getRemoveAttachments()
Return all names of attachments that are going to be removed from this test result, as an array of Strings.- Returns:
- an array of attachment names.
-
getRemoveAttachmentBeans
public LocalTriggerManager.ScriptAttachmentBean[] getRemoveAttachmentBeans()
Return all attachments that are going to be added to this test result, as an array of ScriptAttachmentBeans.- Returns:
- an array of beans representing test result attachments.
-
addToRemoveAttachments
public void addToRemoveAttachments(java.lang.String name) throws mks.frame.triggers.TriggerException
Remove an attachment from this test result.- Parameters:
name
- The name of the attachment to remove.- Throws:
mks.frame.triggers.TriggerException
- if:- the given attachment is already in the remove attachment list.
- the script is running in a POST trigger context
-
removeFromRemoveAttachments
public void removeFromRemoveAttachments(java.lang.String name) throws mks.frame.triggers.TriggerException
Remove an attachment from the list of attachments that are to be removed from this test result.- Parameters:
name
- The name of the attachment to remove from the remove attachment list.- Throws:
mks.frame.triggers.TriggerException
- if:- the attachment is not in the remove attachment list.
- the script is running in a POST trigger context
-
setFieldValue
public void setFieldValue(java.lang.String fieldName, java.lang.String value) throws mks.frame.triggers.TriggerException
Change the value of a result field by name. The value must be representable by a string. e.g. for an integer field, the string must be parsable as an integer.- The value may be null. This unsets the field.
- For a date/time field, the format is always "MM/dd/yyyy HH:mm:ss a z".
- For a picklist, the string must be a valid pick string, or a pick number.
- Parameters:
fieldName
- the name of the result field whose value we want to set. Only fields exposed in the test result by a test result type can be used here.value
- the value to set the field to (as a string)- Throws:
mks.frame.triggers.TriggerException
- An appropriate error message is returned in a TriggerException in the following cases:- The field name isn't known
- If the field is of pick type, the value isn't a valid pick value string, or if a number isn't a valid pick value.
-
setFieldValue
public void setFieldValue(java.lang.String fieldName, double value) throws mks.frame.triggers.TriggerException
Change the value of a result field by name. The field type must be of type float, integer, or date. In the case of a date, the value must be a numeric time value, such as that returned bynew Date().valueOf()
which returns the current time.- Parameters:
fieldName
- the name of the result field whose value we want to set. Only fields exposed in the test result by a test result type can be used here.value
- the value to set the field to (as a double)- Throws:
mks.frame.triggers.TriggerException
- If the field is not a floating point, integer, or date field.
-
setFieldValue
public void setFieldValue(java.lang.String fieldName, java.util.Date value) throws mks.frame.triggers.TriggerException
Change the value of a result field by name. You should use this method to make an assignment to a date field, if you are using a java Date object. If you have a string formatted date or a time since the epoch, then you should use thesetFieldValue
that accepts a string value or double respectively.- Parameters:
fieldName
- the name of the result field whose value we want to set. Only fields exposed in the test result by a test result type can be used here.value
- the value to set the field to (as a java.util.Date)- Throws:
mks.frame.triggers.TriggerException
- If the field doesn't exist or is not a date field.
-
getOldFieldDisplayString
public java.lang.String getOldFieldDisplayString(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the original value of a result field as a printable string.- Parameters:
fieldName
- the name of the result field whose value we return. Only fields exposed in the test result by a test result type can be used here.- Returns:
- a string representing the display value of the result field
- Throws:
mks.frame.triggers.TriggerException
-
getNewFieldDisplayString
public java.lang.String getNewFieldDisplayString(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the new value of a result field as a printable string. If the value is unchanged, the old value is retrieved.- Parameters:
fieldName
- the name of the result field whose value we return. Only fields exposed in the test result by a test result type can be used here.- Returns:
- a string representing the display value of the result field
- Throws:
mks.frame.triggers.TriggerException
-
getOldFieldValue
public java.lang.Object getOldFieldValue(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the old value of the test result field by name. The actual value returned is always a java object:- Integer: Java `Integer' object
- Double: Java `Double' object
- PickList: String name of the picked entry
- Date: Java `Date' object
- Text: String
- Parameters:
fieldName
- the name of the result field whose value we return. Only fields exposed in the test result by a test result type can be used here.- Returns:
- Various, if the field has not been set, the null value.
- Throws:
mks.frame.triggers.TriggerException
- if the field is not known or an error occurs retrieving the value.
-
getNewFieldValue
public java.lang.Object getNewFieldValue(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the new value of the test result field by name. If the value is unchanged, the old value is retrieved. The actual value returned is always a java object:- Integer: Java `Integer' object
- Double: Java `Double' object
- PickList: String name of the picked entry
- Date: Java `Date' object
- Text: String
- Parameters:
fieldName
- the name of the result field whose value we return. Only fields exposed in the test result by a test result type can be used here.- Returns:
- Various, if the field has not been set, the null value.
- Throws:
mks.frame.triggers.TriggerException
- if the field is not known or an error occurs retrieving the value.
-
-