|
jDummy | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Random net.sf.jdummy.generator.DummyValueFactory
public class DummyValueFactory
Factory for generating dummy data. To genearte a value for type T, will use
the Generator set for T if one exists (see setGenerator(Class, Generator)
and DefaultGeneratorBuilder
.
If no explicit Generator exists for T, the factory will create a 'dummy', i.e., create a Mock of T, give it a dummy value generating default stub, and return the proxy.
DummyValueFactory inherits from Random. Tests that use random values should use a single instance of DummyValueFactory to generate all values. Unlike Random, the factory's seed is 0L by default. This makes tests using the factory repeatable: the same sequence value-creation requests will yield the same values.
DummyValueGeneratingStubFactory
,
Serialized FormNested Class Summary | |
---|---|
(package private) static class |
DummyValueFactory.CompatibleMockery
|
Constructor Summary | |
---|---|
DummyValueFactory(Mockery mockery)
|
|
DummyValueFactory(VerifyingTestCase verifier)
Deprecated. |
Method Summary | |
---|---|
java.lang.Object |
dummy(java.lang.Class type)
|
java.lang.Object |
dummy(java.lang.Class type,
java.lang.String name)
|
protected DynamicMock |
dynamicMockForProxy(java.lang.Object dummy)
|
Generator |
getGenerator(java.lang.Class type)
|
protected java.lang.Object |
makeDummyArray(java.lang.Class arrayType,
java.lang.String arrayName)
|
Mock |
mockForProxy(java.lang.Object dummy)
|
java.lang.Object |
newMockWithValueGeneratingStub(java.lang.Class type)
|
java.lang.Object |
newMockWithValueGeneratingStub(java.lang.Class type,
java.lang.String name)
|
java.lang.String |
nextName(java.lang.String baseName)
Returns the next unique name string of the form baseName, baseName-2, ... |
java.lang.String |
OLD_nextName(java.lang.String baseName)
Returns the next unique name string of the form baseName-1, baseName-2, ... |
void |
setGenerator(java.lang.Class type,
Generator generator)
|
Methods inherited from class java.util.Random |
---|
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DummyValueFactory(VerifyingTestCase verifier)
public DummyValueFactory(Mockery mockery)
Method Detail |
---|
public java.lang.Object dummy(java.lang.Class type)
public java.lang.Object dummy(java.lang.Class type, java.lang.String name)
public Mock mockForProxy(java.lang.Object dummy)
protected DynamicMock dynamicMockForProxy(java.lang.Object dummy)
public void setGenerator(java.lang.Class type, Generator generator)
public Generator getGenerator(java.lang.Class type)
protected java.lang.Object makeDummyArray(java.lang.Class arrayType, java.lang.String arrayName)
public java.lang.Object newMockWithValueGeneratingStub(java.lang.Class type)
public java.lang.Object newMockWithValueGeneratingStub(java.lang.Class type, java.lang.String name)
public java.lang.String OLD_nextName(java.lang.String baseName)
public java.lang.String nextName(java.lang.String baseName)
|
jDummy | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |