public class ActionsUtil
extends java.lang.Object
Constructor and Description |
---|
ActionsUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
callCron(java.lang.String crontaskName,
java.lang.String instanceName,
UserInfo userInfo)
This method would call the cronAction method on the cron task
crontaskName
instance instanceName . |
static void |
callWorkflow(java.lang.String wfName,
MboRemote mbo)
Action method to call a Maximo workflow.
|
static void |
commit(MboRemote mbo)
Commits the MXTransaction for the Mbo
mbo . |
static <E extends MboRemote> |
commitAndRefetch(E mbo)
Commits the MXTransaction for the Mbo
mbo and immediately
refetches it from the Maximo database. |
static java.lang.String |
generateRelationName()
Generates a random temporary relation name
|
static boolean |
getBooleanExpression(MboRemote mbo,
java.lang.String expression) |
static boolean |
getBooleanProperty(java.lang.String name) |
static java.util.Date |
getDateExpression(MboRemote mbo,
java.lang.String expression) |
static java.util.Date |
getDateProperty(java.lang.String name)
Return property value for specified property as Date
|
static double |
getDoubleExpression(MboRemote mbo,
java.lang.String expression) |
static java.lang.Double |
getDoubleProperty(java.lang.String name)
Return property value for specified property as Double
|
static java.lang.Integer |
getIntegerProperty(java.lang.String name)
Return property value for specified property as Integer
|
static int |
getIntExpression(MboRemote mbo,
java.lang.String expression) |
static long |
getLongExpression(MboRemote mbo,
java.lang.String expression) |
static java.lang.Long |
getLongProperty(java.lang.String name)
Return proprty value for specified property as Long
|
static java.lang.Object |
getObjectExpression(MboRemote mbo,
java.lang.String expression) |
static java.lang.Object |
getObjectProperty(java.lang.String propName)
Deprecated.
|
static java.lang.String |
getProperty(java.lang.String name) |
static java.util.List<java.lang.String> |
getPropertyAsList(java.lang.String name) |
static java.util.Date |
getServerDate()
Action method to get Maximo server date.
|
static java.lang.String |
getStringExpression(MboRemote mbo,
java.lang.String expression) |
static byte[] |
getTestDataAsBytes(java.lang.String testdataId)
This is used the access the test data content as a bytes.
|
static org.jdom.Document |
getTestDataAsDocument(java.lang.String testdataId)
This is used the access the test data content as a JDOM document.
|
static TestDataSource |
getTestDataSource()
Utility method to acccess the TestDataSource object from the unit test context.
|
static java.lang.Object |
getTestVariable(java.lang.String propName) |
static UserInfo |
getUserInfo()
Utility method to acccess the UserInfo object from the unit test context.
|
static java.lang.String |
getXMLValue(java.lang.String xpathExpression,
java.util.Map<java.lang.String,java.lang.String> nsPrefixMap,
org.jdom.Document doc) |
static java.lang.String |
getXMLValue(java.lang.String xpathExpression,
java.util.Map<java.lang.String,java.lang.String> nsPrefixMap,
java.lang.String testdataId) |
static MboRemote |
load(java.lang.String testdataId)
loads the Mbo for the
testdataId . |
static MboRemote |
load(java.lang.String mboname,
long id) |
static MboRemote |
load(java.lang.String testdataId,
UserInfo userInfo)
Loads the Mbo for the
testdataId and the UserInfo object passed in parameter
would be used for the load. |
static MboSetRemote |
loadMboSet(java.lang.String[] testdataIds)
loads the Mbo for the
testdataId . |
static <E extends MboRemote> |
refetch(E mbo)
Utility method to refetch
mbo from the Maximo database. |
static MboRemote |
reload(java.lang.String testdataId)
Reloads the Mbo for the
testdataId , meaning it will be fetched from the database again instead of
the test data cache. |
static void |
rollback(MboRemote mbo)
Rolls back the MXTransaction for the Mbo
mbo
If a failure happens an assertion error is generated. |
static void |
setObjectProperty(java.lang.String propName,
java.lang.Object value)
Deprecated.
|
static void |
setTestVariable(java.lang.String propName,
java.lang.Object value) |
static void |
updateMaxVar(java.lang.String varName,
java.lang.String varValue) |
static void |
updateMaxVar(java.lang.String varName,
java.lang.String orgId,
java.lang.String siteId,
java.lang.String varValue) |
static MaxVarsRemote |
updateMaxVar(UserInfo userInfo,
java.lang.String varName,
java.lang.String orgId,
java.lang.String siteId,
java.lang.String varValue) |
public static MboRemote load(java.lang.String mboname, long id) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public static MboRemote load(java.lang.String testdataId) throws MXException, TestSetupException
testdataId
. The context UserInfo would be used for the load.testdataId
- the fully qualified test data id.MXException
TestSetupException
public static MboRemote reload(java.lang.String testdataId) throws MXException, TestSetupException
testdataId
, meaning it will be fetched from the database again instead of
the test data cache. The context UserInfo would be used for the load.testdataId
- the fully qualified test data id.MXException
TestSetupException
public static MboSetRemote loadMboSet(java.lang.String[] testdataIds) throws MXException, TestSetupException
testdataId
. The context UserInfo would be used for the load.testdataId
- the fully qualified test data id.MXException
TestSetupException
public static MboRemote load(java.lang.String testdataId, UserInfo userInfo) throws MXException, TestSetupException
testdataId
and the UserInfo object passed in parameter
would be used for the load.testdataId
- the fully qualified test data id.userInfo
- the UserInfo to be used for the load.MXException
TestSetupException
public static byte[] getTestDataAsBytes(java.lang.String testdataId) throws MXException, TestSetupException
testdataId
- the fully qualified test data id.MXException
TestSetupException
public static java.lang.String getXMLValue(java.lang.String xpathExpression, java.util.Map<java.lang.String,java.lang.String> nsPrefixMap, org.jdom.Document doc) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getXMLValue(java.lang.String xpathExpression, java.util.Map<java.lang.String,java.lang.String> nsPrefixMap, java.lang.String testdataId) throws java.lang.Exception
java.lang.Exception
public static org.jdom.Document getTestDataAsDocument(java.lang.String testdataId) throws MXException, TestSetupException
testdataId
- MXException
TestSetupException
public static void callCron(java.lang.String crontaskName, java.lang.String instanceName, UserInfo userInfo) throws MXException
crontaskName
instance instanceName
.crontaskName
- the cron task nameinstanceName
- the instance nameuserInfo
- the user to be used for accessing the cron task Mbo. Note this is need not be the
same as the "runas" user configured in the task.MXException
public static void callWorkflow(java.lang.String wfName, MboRemote mbo) throws MXException
wfName
- the name of the workflow processmbo
- the mbo for the workflow.MXException
public static java.util.Date getServerDate()
public static <E extends MboRemote> E refetch(E mbo) throws java.rmi.RemoteException, MXException
mbo
from the Maximo database.mbo
- the Mbo to be refetched.java.rmi.RemoteException
MXException
public static UserInfo getUserInfo()
public static TestDataSource getTestDataSource()
@Deprecated public static void setObjectProperty(java.lang.String propName, java.lang.Object value)
@Deprecated public static java.lang.Object getObjectProperty(java.lang.String propName)
public static void setTestVariable(java.lang.String propName, java.lang.Object value)
public static java.lang.Object getTestVariable(java.lang.String propName)
public static void rollback(MboRemote mbo)
mbo
If a failure happens an assertion error is generated.mbo
- public static <E extends MboRemote> E commitAndRefetch(E mbo) throws java.rmi.RemoteException, MXException
mbo
and immediately
refetches it from the Maximo database.mbo
- The MBO to be committed.MXException
java.rmi.RemoteException
public static void commit(MboRemote mbo)
mbo
.
If a failure happens an assertion error is generated.mbo
- public static java.lang.String generateRelationName()
public static java.lang.Object getObjectExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static java.lang.String getProperty(java.lang.String name)
name
- property namepublic static boolean getBooleanProperty(java.lang.String name) throws TestSetupException
name
- property nameTestSetupException
public static java.lang.Integer getIntegerProperty(java.lang.String name) throws TestSetupException
propName
- property nameTestSetupException
public static java.lang.Long getLongProperty(java.lang.String name) throws TestSetupException
propName
- property nameTestSetupException
public static java.lang.Double getDoubleProperty(java.lang.String name) throws TestSetupException
propName
- property nameTestSetupException
public static java.util.Date getDateProperty(java.lang.String name) throws TestSetupException
propName
- property nameTestSetupException
public static java.util.List<java.lang.String> getPropertyAsList(java.lang.String name)
name
- public static boolean getBooleanExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static int getIntExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static double getDoubleExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static long getLongExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static java.util.Date getDateExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static java.lang.String getStringExpression(MboRemote mbo, java.lang.String expression) throws java.lang.Exception
mbo
- expression
- java.lang.Exception
public static void updateMaxVar(java.lang.String varName, java.lang.String varValue) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public static void updateMaxVar(java.lang.String varName, java.lang.String orgId, java.lang.String siteId, java.lang.String varValue) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public static MaxVarsRemote updateMaxVar(UserInfo userInfo, java.lang.String varName, java.lang.String orgId, java.lang.String siteId, java.lang.String varValue) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException