|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.JWalker org.jwalk.core.ClassInspector org.jwalk.core.ProtocolWalker org.jwalk.core.AlgebraWalker
public class AlgebraWalker
AlgebraWalker exercises all the algebraic constructions of the test class. An AlgebraWalker explores all the unique constructions possible with the test class's constructors and methods. It detects empirically if a sequence returns to an existing state, or leaves the state unchanged, and prunes these redundant paths. It therefore explores many fewer paths than a ProtocolWalker.
Field Summary | |
---|---|
protected java.util.Map<java.lang.reflect.Member,Category> |
category
The map from members to algebraic categories. |
Fields inherited from class org.jwalk.core.ProtocolWalker |
---|
oracle, summary |
Fields inherited from class org.jwalk.core.ClassInspector |
---|
constants, constructors, methods, testClass |
Fields inherited from class org.jwalk.JWalker |
---|
channels, settings |
Constructor Summary | |
---|---|
AlgebraWalker(Settings settings,
Channels channels)
Creates an AlgebraWalker, using the settings and channels. |
Method Summary | |
---|---|
protected void |
discoverAlgebra()
Estimates the algebraic categories of the test class's operations. |
void |
execute()
Executes this AlgebraWalker test strategy according to the settings. |
protected void |
executeProbeCycle(java.util.List<TestSequence> testSet,
int cycle)
Executes one probing cycle, refining the algebraic category of methods. |
Category |
getCategory(java.lang.Enum<?> constant)
Returns the algebraic category of an enumerated constant. |
Category |
getCategory(java.lang.reflect.Member member)
Returns the algebraic category of a Field, Constructor, or Method. |
protected boolean |
isPrunable(TestSequence sequence)
Reports whether a given TestSequence may be pruned. |
Methods inherited from class org.jwalk.core.ProtocolWalker |
---|
ensureExecutable, executeTestCycle, executeTestSeries, firstCycle, makeGenerator, nextCycle |
Methods inherited from class org.jwalk.core.ClassInspector |
---|
classIsAbstract, classIsEnum, classIsInterface, classNotPublic, countActiveEdges, countConstants, countConstructors, countMethods, countPermutations, getConstants, getConstructors, getMethods, getTestClass, inspectProtocols |
Methods inherited from class org.jwalk.JWalker |
---|
getChannels, getSettings, outOfMemory, run, userAborted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.reflect.Member,Category> category
Constructor Detail |
---|
public AlgebraWalker(Settings settings, Channels channels)
settings
- the test parameter settings to use.channels
- the call-back channels to report on.Method Detail |
---|
public Category getCategory(java.lang.Enum<?> constant)
constant
- an enumerated constant.
public Category getCategory(java.lang.reflect.Member member)
getOperation()
in TestCase and TestSequence, which returns
a value of the type Member, generalising over Constructors, Methods and
constant Fields. Only valid after this AlgebraWalker has inspected the
test class and performed a dynamic probing analysis.
member
- a constant Field, Constructor or Method to look up.
protected boolean isPrunable(TestSequence sequence)
isPrunable
in class ProtocolWalker
sequence
- the TestSequence being evaluated.
protected void executeProbeCycle(java.util.List<TestSequence> testSet, int cycle) throws PermissionException, GeneratorException, ExecutionException
testSet
- the current test set.cycle
- the probe cycle number.
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, for reasons of visibility, security or bad arguments, or if
it is detected that a constructor or method behaves randomly.
PermissionException
- if the loaded test class, or any custom
generator, could not be instantiated, either for reasons of security,
or visibility, or because it was abstract, or an interface.protected void discoverAlgebra() throws PermissionException, GeneratorException, ExecutionException
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, for reasons of visibility, security or bad arguments, or if
it is detected that a constructor or method behaves randomly.
PermissionException
- if the loaded test class, or any custom
generator, could not be instantiated, either for reasons of security,
or visibility, or because it was abstract, or an interface.public void execute() throws PermissionException, GeneratorException, ExecutionException
execute
in class ProtocolWalker
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, for reasons of visibility, security or bad arguments, or if
it is detected that a constructor or method behaves randomly.
PermissionException
- if the loaded test class, or any custom
generator, could not be instantiated, either for reasons of security,
or visibility, or because it was abstract, or an interface.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |