public abstract class UnitTestUtil
extends java.lang.Object
MaximoPrimaryKeyFilter
to the database connection it is listening to.Constructor and Description |
---|
UnitTestUtil() |
Modifier and Type | Method and Description |
---|---|
static MboRemote[] |
createMbo(MboRemote parent,
java.lang.String objectName,
java.util.Map<java.lang.String,java.lang.Object>[] attributesBatch,
UserInfo userInfo) |
static MboRemote[] |
createMbo(MboRemote parent,
java.lang.String objectName,
java.util.Map<java.lang.String,java.lang.Object> attributes,
UserInfo userInfo) |
static void |
deleteRecords(java.lang.String objectName,
java.lang.String whereClause,
UserInfo userInfo) |
static java.lang.String |
getMaximoPresentation(java.lang.String presentationName,
java.lang.String userName)
Retrieves a Maximo presentation from the Maximo database
|
static java.lang.String |
getMaximoPresentation(java.lang.String presentationName,
UserInfo userInfo)
Retrieves a Maximo presentation from the Maximo database
|
static MboSetRemote |
getMboSet(java.lang.String mboSetName,
java.lang.String whereClause,
UserInfo userInfo)
TODO Fill-in method description and parameters.
|
static MboSetRemote |
getMboSet(java.lang.String mboSetName,
UserInfo userInfo)
TODO Fill-in method description and parameters.
|
static java.lang.Object |
getPrivateField(java.lang.Object classInstance,
java.lang.String fieldName)
Obtains a field from a class instance.
|
static UserInfo |
getUserInfo(java.lang.String userName)
Internal use only
|
static UserInfo |
getUserInfo(java.lang.String userName,
java.lang.String password)
Deprecated.
Use
getUserInfo(final String userName) instead |
static java.lang.Object |
invokeMethod(java.lang.Object classInstance,
java.lang.String methodName,
java.lang.Object[] params)
Invokes a method on an object instance.
|
static void |
setObjectAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes,
MboRemote mbo) |
public static java.lang.Object getPrivateField(java.lang.Object classInstance, java.lang.String fieldName) throws java.lang.Exception
To be used exclusively within JUnit test cases
classInstance
- The instance from which to get the field valuefieldName
- The name of the requested fieldjava.lang.Exception
public static java.lang.Object invokeMethod(java.lang.Object classInstance, java.lang.String methodName, java.lang.Object[] params) throws java.lang.Throwable
To be used exclusively within JUnit test cases
classInstance
- The instance on which to call the methodmethodName
- The name of the method to invokeparams
- The paremeters for the method. Can be null
for a method that takes no
parameters. Integral types need to be wrapped in a class instance. The caller should
construct them using this pseudocode:
final Object params[] = { param1_instance, param2_instance, ... };
java.lang.Throwable
- Passes along any exception that the invoked method could throwpublic static java.lang.String getMaximoPresentation(java.lang.String presentationName, java.lang.String userName) throws java.lang.Exception
To be used exclusively within DBUnit test cases
presentationName
- The name of the presentation to be loadeduserName
- The user name - will be authenticated without password informationjava.lang.Throwable
- Passes along any exception that the invoked method could throwjava.lang.Exception
public static java.lang.String getMaximoPresentation(java.lang.String presentationName, UserInfo userInfo) throws java.lang.Exception
To be used exclusively within DBUnit test cases
presentationName
- The name of the presentation to be loadeduserInfo
- The authenticated user info structurejava.lang.Throwable
- Passes along any exception that the invoked method could throwjava.lang.Exception
public static UserInfo getUserInfo(java.lang.String userName, java.lang.String password) throws java.lang.Exception
getUserInfo(final String userName)
insteadGet the authenticated user info
java.lang.Exception
public static UserInfo getUserInfo(java.lang.String userName) throws java.lang.Exception
Get the authenticated user info
java.lang.Exception
public static MboSetRemote getMboSet(java.lang.String mboSetName, UserInfo userInfo) throws java.lang.Exception
-
java.lang.Exception
public static MboSetRemote getMboSet(java.lang.String mboSetName, java.lang.String whereClause, UserInfo userInfo) throws java.lang.Exception
-
java.lang.Exception
public static void deleteRecords(java.lang.String objectName, java.lang.String whereClause, UserInfo userInfo) throws java.lang.Exception
java.lang.Exception
public static MboRemote[] createMbo(MboRemote parent, java.lang.String objectName, java.util.Map<java.lang.String,java.lang.Object> attributes, UserInfo userInfo) throws java.lang.Exception
java.lang.Exception
public static MboRemote[] createMbo(MboRemote parent, java.lang.String objectName, java.util.Map<java.lang.String,java.lang.Object>[] attributesBatch, UserInfo userInfo) throws java.lang.Exception
java.lang.Exception
public static void setObjectAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes, MboRemote mbo) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException