Package mks.ci.server.engine
Class LocalTriggerManager.ScriptTestResultBean
- java.lang.Object
-
- mks.frame.triggers.ScriptExposableBaseBean
-
- mks.frame.triggers.beans.ScriptBaseBean
-
- mks.ci.server.engine.LocalTriggerManager.ScriptIMBaseBean
-
- mks.ci.server.engine.LocalTriggerManager.ScriptTestResultBean
-
- All Implemented Interfaces:
mks.frame.triggers.ScriptExposableBean
- Direct Known Subclasses:
LocalTriggerManager.ScriptTestResultDeltaBean
- Enclosing class:
- LocalTriggerManager
public static class LocalTriggerManager.ScriptTestResultBean extends LocalTriggerManager.ScriptIMBaseBean implements mks.frame.triggers.ScriptExposableBean
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
in a delete test result trigger, or from any of the test result functions onLocalTriggerManager.ScriptIssueBean
:getRelatedTestResultBeans
,getAssociatedSessionTestResultBeans
, orgetTestCaseAssociatedTestResultBeans
.This bean provides read-only access. All information on the test result is available to this bean. Test result metadata, if available, is exposed for access on this bean via the
getFieldValue
andgetFieldDisplayString
methods.
-
-
Constructor Summary
Constructors Constructor Description ScriptTestResultBean(mks.ci.server.engine.TestResult testResult, int userId, java.sql.Connection c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAnnotation()
Gets the annotation of this test result.LocalTriggerManager.ScriptAttachmentBean[]
getAttachmentBeans()
Returns all attachments of this test result as an array of ScriptAttachmentBeans.java.lang.String[]
getAttachments()
Return all attachments of this test result as an array of Strings representing the attachment name.LocalTriggerManager.ScriptIssueBean
getCaseBean()
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the test case of this test result.int
getCaseID()
Returns the Windchill RV&S item id of the item that acts as the test case of this test result.java.lang.String
getExposedName()
Returns the name of this bean that is exposed to the scripting language.java.lang.String
getFieldDisplayString(java.lang.String fieldName)
Retrieve the value of a result field as a printable string.java.lang.Object
getFieldValue(java.lang.String fieldName)
Retrieve the value of the field by name.LocalTriggerManager.ScriptIssueBean[]
getRelatedItemBeans()
Returns all items that are related to this test result as an array of ScriptIssueBeans.int[]
getRelatedItems()
Returns all items that are related to this test result as an array of Windchill RV&S item ids.LocalTriggerManager.ScriptIssueBean
getSessionBean()
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the test session of this test result.int
getSessionID()
Returns the Windchill RV&S item id of the item that acts as the test session of this test result.LocalTriggerManager.ScriptIssueBean
getSharesCaseBean()
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the shares test case of this test result.int
getSharesCaseID()
Returns the Windchill RV&S item id of the item that acts as the shares test case of this test result.LocalTriggerManager.ScriptTestStepResultBean[]
getStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the test step results of this test result, or null if there are no test step results.java.lang.String
getVerdict()
Returns the name of the verdict set for this test result, or null if no verdict has been set.LocalTriggerManager.ScriptTestVerdictBean
getVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the verdict set for this test result, or null if no verdict has been set.java.lang.String
getVerdictType()
Returns the name of the verdict type set for this test result (e.g.LocalTriggerManager.ScriptVerdictTypeBean
getVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the verdict type set for this test result, or null if no verdict has been set.boolean
hasAttachments()
Returns true if this test result has attachments.boolean
hasRelatedItems()
Returns true if this test result has related itemsboolean
hasStepResults()
Returns true if this test result has test step results.boolean
hasVerdict()
Returns true if the verdict is set for this test step result.boolean
isRelatedItem(int relatedItem)
Return true if the given item is related to this test result.-
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
- Specified by:
getExposedName
in classScriptBaseBean
- Returns:
- the bean name:
siMemberBean
.
-
getSessionID
public int getSessionID()
Returns the Windchill RV&S item id of the item that acts as the test session of this test result.- Returns:
- the Session ID of this test result.
-
getSessionBean
public LocalTriggerManager.ScriptIssueBean getSessionBean() throws mks.frame.triggers.TriggerException
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the test session of this test result.- Returns:
- A bean representing Windchill RV&S item.
- Throws:
mks.frame.triggers.TriggerException
- if the item could not be retrieved.
-
getCaseID
public int getCaseID()
Returns the Windchill RV&S item id of the item that acts as the test case of this test result.- Returns:
- the Case ID of this test result.
-
getCaseBean
public LocalTriggerManager.ScriptIssueBean getCaseBean() throws mks.frame.triggers.TriggerException
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the test case of this test result.- Returns:
- A bean representing Windchill RV&S item.
- Throws:
mks.frame.triggers.TriggerException
- if the item could not be retrieved.
-
getSharesCaseID
public int getSharesCaseID()
Returns the Windchill RV&S item id of the item that acts as the shares test case of this test result.- Returns:
- the Shares Case ID of this test result.
-
getSharesCaseBean
public LocalTriggerManager.ScriptIssueBean getSharesCaseBean() throws mks.frame.triggers.TriggerException
Returns aLocalTriggerManager.ScriptIssueBean
representing the Windchill RV&S item that acts as the shares test case of this test result.- Returns:
- A bean representing Windchill RV&S item,
- Throws:
mks.frame.triggers.TriggerException
- if the item could not be retrieved.
-
hasVerdict
public boolean hasVerdict()
Returns true if the verdict is set for this test step result.- Returns:
- true if this test result has a verdict, false otherwise.
-
getVerdict
public java.lang.String getVerdict()
Returns the name of the verdict set 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.
-
getVerdictBean
public LocalTriggerManager.ScriptTestVerdictBean getVerdictBean()
Returns aLocalTriggerManager.ScriptTestVerdictBean
representing the verdict set for this test result, or null if no verdict has been set.- Returns:
- A
LocalTriggerManager.ScriptTestVerdictBean
, or null if no verdict is set.
-
getVerdictType
public java.lang.String getVerdictType()
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.- Returns:
- A string representing the verdict type, or null if no verdict has been set.
-
getVerdictTypeBean
public LocalTriggerManager.ScriptVerdictTypeBean getVerdictTypeBean()
Returns aLocalTriggerManager.ScriptVerdictTypeBean
representing the verdict type set for this test result, or null if no verdict has been set.- Returns:
- A
LocalTriggerManager.ScriptVerdictTypeBean
, or null if no verdict has been set.
-
getAnnotation
public java.lang.String getAnnotation()
Gets the annotation of this test result.- Returns:
- The annotation of this test result.
-
hasStepResults
public boolean hasStepResults()
Returns true if this test result has test step results.- Returns:
- true if this test result has test step results, false otherwise.
-
getStepResultBeans
public LocalTriggerManager.ScriptTestStepResultBean[] getStepResultBeans()
Returns an array ofLocalTriggerManager.ScriptTestStepResultBean
representing the test step results of this test result, or null if there are no test step results.- Returns:
- an array of
LocalTriggerManager.ScriptTestStepResultBean
.
-
hasRelatedItems
public boolean hasRelatedItems()
Returns true if this test result has related items- Returns:
- true if this test result has related items, false otherwise.
-
isRelatedItem
public boolean isRelatedItem(int relatedItem)
Return true if the given item is related to this test result.- Parameters:
relatedItem
- the Windchill RV&S item ID to test for a relationship.- Returns:
- true if the given item is related to this test result, false otherwise.
-
getRelatedItems
public int[] getRelatedItems()
Returns all items that are related to this test result as an array of Windchill RV&S item ids.- Returns:
- An array of Windchill RV&S item ids.
-
getRelatedItemBeans
public LocalTriggerManager.ScriptIssueBean[] getRelatedItemBeans() throws mks.frame.triggers.TriggerException
Returns all items that are related to this test result as an array of ScriptIssueBeans.- Returns:
- An array of beans representing Windchill RV&S items related to this test result.
- Throws:
mks.frame.triggers.TriggerException
-
hasAttachments
public boolean hasAttachments()
Returns true if this test result has attachments.- Returns:
- true if this test result has attachments, false otherwise.
-
getAttachments
public java.lang.String[] getAttachments()
Return all attachments of this test result as an array of Strings representing the attachment name.- Returns:
- An array of strings representing test result attachments.
-
getAttachmentBeans
public LocalTriggerManager.ScriptAttachmentBean[] getAttachmentBeans()
Returns all attachments of this test result as an array of ScriptAttachmentBeans.- Returns:
- An array of beans representing test result attachments.
-
getFieldDisplayString
public java.lang.String getFieldDisplayString(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the 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
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String fieldName) throws mks.frame.triggers.TriggerException
Retrieve the value of the 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.
-
-