|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.core.StateInspector
public class StateInspector
StateInspector inspects the concrete state of a test object.
A StateInspector computes an integral encoding of the concrete state of
a test object. Each time a test object re-enters the same concrete state,
the StateInspector must return the same state code. The notion of state is
nonetheless variable, depending on whether the test object is explored to
a shallow, medium or deep level. This is controlled by the depth parameter
supplied at construction, obtained from the treeDepth
parameter
in the owning JWalker's Settings.
Constructor Summary | |
---|---|
StateInspector()
Creates a StateInspector that examines to the 0 depth. |
|
StateInspector(int depth)
Creates a StateInspector that examines to the given depth. |
Method Summary | |
---|---|
protected java.util.List<java.lang.reflect.Field> |
getFields(java.lang.Class<?> testClass)
Determines all the fields of the current test class. |
int |
inspect(java.lang.Object testObject)
Inspects the current state of the test object. |
protected int |
inspectArray(java.lang.Class<?> type,
java.lang.Object array,
int depth)
Returns an encoding of the state of a primitive array. |
protected int |
inspectObject(java.lang.Class<?> testClass,
java.lang.Object testObject,
int depth)
Returns an encoding of the state of the test object to a given depth. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateInspector()
public StateInspector(int depth)
depth
- the depth of inspection.Method Detail |
---|
public int inspect(java.lang.Object testObject)
testObject
- the test object in a given state.
protected int inspectObject(java.lang.Class<?> testClass, java.lang.Object testObject, int depth)
testClass
- the class of the test object.testObject
- a non-null test object in a given state.depth
- the depth to which the reachable object tree is explored.
protected int inspectArray(java.lang.Class<?> type, java.lang.Object array, int depth)
type
- the type of the arrayarray
- a non-null primitive array in a given filled state.depth
- the depth to which the reachable object tree is explored.
protected java.util.List<java.lang.reflect.Field> getFields(java.lang.Class<?> testClass)
testClass
- the class from which to extract fields.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |