public class MboMocker
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MboMocker.MboEnhancer
Used to enhance a Mbo during Mock Creation
|
Modifier and Type | Method and Description |
---|---|
<T extends MAXTableDomain> |
createMAXTableDomain(java.lang.Class<T> type,
MboValue mboValue) |
<T extends Mbo> |
createMbo(java.lang.Class<T> mboClass) |
<T extends Mbo> |
createMbo(java.lang.Class<T> mboClass,
boolean mockMboValue) |
<T extends Mbo> |
createMbo(MboSet mboSet,
java.lang.Class<T> mboClass) |
<T extends Mbo> |
createMbo(MboSet mboSet,
java.lang.Class<T> mboClass,
boolean mockMboValue) |
java.util.Vector<MboRemote> |
createMboRemoteVector(int numMbos) |
java.util.Vector<MboRemote> |
createMboRemoteVector(int numMbos,
java.lang.Class mboType) |
MboSetRemote |
createMboSetRemote(int count,
java.lang.Class mboType,
MboMocker.MboEnhancer enhancer)
Mocks a MboSet with MboEnhancer (
|
MboSetRemote |
createMboSetRemote(int count,
MboMocker.MboEnhancer enhancer)
Creates a new MboSetRemote with a fixed number of empty items int he MboSet.
|
<T extends Mbo> |
createMboValue(java.lang.Class<T> backingMboType) |
Mbo |
createMockMboRemote() |
Mbo |
createMockMboRemote(java.lang.Class mboType) |
Mbo |
createMockMboRemote(MboSet mboSet) |
Mbo |
createMockMboRemote(MboSet mboSet,
java.lang.Class mboClass) |
<T extends NonPersistentMbo> |
createNonPersistentMbo(java.lang.Class<T> mboClass)
Creates a
StatefulMbo subclass of the specified type. |
<T extends StatefulMbo> |
createStatefulMbo(java.lang.Class<T> mboClass)
Creates a
StatefulMbo subclass of the specified type. |
MboSet |
mockMboSet()
Mocks a
MboSet |
<T extends MboSet> |
mockMboSet(java.lang.Class<T> mbosetClass)
Mocks a
MboSet of a given type |
MboSetInfo |
mockMboSetInfo() |
void |
mockSingleResultMboSet(MboSetRemote mboSet) |
public static MboMocker INSTANCE
public MboSet mockMboSet()
MboSet
java.rmi.RemoteException
MXException
public <T extends MboSet> T mockMboSet(java.lang.Class<T> mbosetClass)
MboSet
of a given typejava.rmi.RemoteException
MXException
public Mbo createMockMboRemote(MboSet mboSet) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public Mbo createMockMboRemote(MboSet mboSet, java.lang.Class mboClass) throws java.rmi.RemoteException, MXException
java.rmi.RemoteException
MXException
public MboSetInfo mockMboSetInfo()
public <T extends StatefulMbo> T createStatefulMbo(java.lang.Class<T> mboClass)
StatefulMbo
subclass of the specified type.
This is useful when unit testing aspects of a class that extends a StatefulMbo
. The returned
object will have many mbo features mocked (or mockable) while leaving the extended class'
methods untouched so that their "real" code can be invoked and unit tested.
For example, if a WO()
is passed in as input, the returned WO
instance will have no mocking behavior
for any of the methods defined directly on the WO
class itself. In contrast, many of the features of the WO
class' underlying StatefulMbo
will be mocked (or mockable) so the work order unit test can focus as
much on the work order as possible.
mboClass
- type of StatefulMbo
to createpublic <T extends NonPersistentMbo> T createNonPersistentMbo(java.lang.Class<T> mboClass)
StatefulMbo
subclass of the specified type.
This is useful when unit testing aspects of a class that extends a StatefulMbo
. The returned
object will have many mbo features mocked (or mockable) while leaving the extended class'
methods untouched so that their "real" code can be invoked and unit tested.
For example, if a WO()
is passed in as input, the returned WO
instance will have no mocking behavior
for any of the methods defined directly on the WO
class itself. In contrast, many of the features of the WO
class' underlying StatefulMbo
will be mocked (or mockable) so the work order unit test can focus as
much on the work order as possible.
mboClass
- type of StatefulMbo
to createpublic <T extends MAXTableDomain> T createMAXTableDomain(java.lang.Class<T> type, MboValue mboValue)
public void mockSingleResultMboSet(MboSetRemote mboSet) throws java.lang.Exception
java.lang.Exception
public <T extends Mbo> T createMbo(MboSet mboSet, java.lang.Class<T> mboClass, boolean mockMboValue)
public <T extends Mbo> T createMbo(java.lang.Class<T> mboClass)
public <T extends Mbo> T createMbo(java.lang.Class<T> mboClass, boolean mockMboValue)
public java.util.Vector<MboRemote> createMboRemoteVector(int numMbos, java.lang.Class mboType)
public java.util.Vector<MboRemote> createMboRemoteVector(int numMbos)
public Mbo createMockMboRemote()
public Mbo createMockMboRemote(java.lang.Class mboType)
public MboSetRemote createMboSetRemote(int count, MboMocker.MboEnhancer enhancer) throws java.rmi.RemoteException, MXException
count
- enhancer
- java.rmi.RemoteException
MXException
public MboSetRemote createMboSetRemote(int count, java.lang.Class mboType, MboMocker.MboEnhancer enhancer) throws java.rmi.RemoteException, MXException
count
- enhancer
- java.rmi.RemoteException
MXException