|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.core.TestCase org.jwalk.core.ParamTestCase
public abstract class ParamTestCase
ParamTestCase is a kind of test case that accepts input parameters. ParamTestCase is the abstract parent of InvokeTestCase (for methods) and CreateTestCase (for constructors), which may require input parameters.
Field Summary | |
---|---|
protected boolean |
isBinary
A flag to indicate that the tested operation is a binary method. |
protected java.lang.Class<?>[] |
paramTypes
The parameter types of the tested operation. |
protected java.lang.Object[] |
paramValues
The parameter values for the tested operation. |
Fields inherited from class org.jwalk.core.TestCase |
---|
inspector, state |
Constructor Summary | |
---|---|
protected |
ParamTestCase(java.lang.reflect.Constructor<?> constructor)
Creates a ParamTestCase for a Constructor. |
protected |
ParamTestCase(java.lang.reflect.Method method)
Creates a ParamTestCase for a Method. |
Method Summary | |
---|---|
ParamTestCase |
clone()
Clones a shallow copy of this ParamTestCase. |
java.lang.Object |
execute(ObjectGenerator generator,
java.lang.Object target)
Executes this ParamTestCase, returning null. |
java.lang.String |
getKey(ObjectGenerator generator)
Returns a unique indexing key for this ParamTestCase. |
java.lang.String |
toString(ObjectGenerator generator)
Returns a pretty-printed representation of this ParamTestCase. |
Methods inherited from class org.jwalk.core.TestCase |
---|
getOperation, getReturnType, getState, setInspector |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isBinary
protected java.lang.Class<?>[] paramTypes
protected java.lang.Object[] paramValues
Constructor Detail |
---|
protected ParamTestCase(java.lang.reflect.Constructor<?> constructor)
protected ParamTestCase(java.lang.reflect.Method method)
Method Detail |
---|
public ParamTestCase clone()
clone
in class TestCase
public java.lang.Object execute(ObjectGenerator generator, java.lang.Object target) throws java.lang.reflect.InvocationTargetException, GeneratorException, ExecutionException
execute
in class TestCase
generator
- the ObjectGenerator for synthesising test inputs.target
- the target object, initially null.
java.lang.reflect.InvocationTargetException
- if the tested operation raises
an exception internally. This is later handled by TestSequence, which
reports the exception as the result of the test.
GeneratorException
- if any constructor or method argument value
could not be synthesised. A CustomGenerator must be provided that is
capable of synthesising values of the argument type.
ExecutionException
- if any constructor or method could not be
invoked, or if it exhibited unpredictable random behaviour.public java.lang.String getKey(ObjectGenerator generator)
getKey
in class TestCase
generator
- the ObjectGenerator which synthesised the parameters.
public java.lang.String toString(ObjectGenerator generator)
toString
in class TestCase
generator
- the ObjectGenerator which synthesised the parameters.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |