|
|||||||||
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
public class ProtocolWalker
ProtocolWalker exercises all the method protocols of a test class. A ProtocolWalker explores all possible permutations of the test class's public methods. It constructs test sequences, starting with all of the test class's public constructors, then extends these with all possible interleaved orderings of the test class's public methods.
Field Summary | |
---|---|
protected Oracle |
oracle
The test oracle used to store and predict test outcomes. |
protected SummaryReport |
summary
The test summary report that is published when testing is finished. |
Fields inherited from class org.jwalk.core.ClassInspector |
---|
constants, constructors, methods, testClass |
Fields inherited from class org.jwalk.JWalker |
---|
channels, settings |
Constructor Summary | |
---|---|
ProtocolWalker(Settings settings,
Channels channels)
Creates a ProtocolWalker, using the settings and channels. |
Method Summary | |
---|---|
protected void |
ensureExecutable()
Checks that the test class may indeed be executed. |
void |
execute()
Executes this ProtocolWalker test strategy according to the settings. |
protected void |
executeTestCycle(java.util.List<TestSequence> testSet,
int cycle)
Executes a test set for a given test cycle and reports the results. |
protected void |
executeTestSeries()
Executes a series of test cycles on paths of increasing length. |
protected java.util.List<TestSequence> |
firstCycle()
Creates the first test set, consisting of singleton TestSequences made from each of the public Constructors (or enumerated constants) of the test class. |
protected boolean |
isPrunable(TestSequence sequence)
Reports whether a given TestSequence may be pruned. |
protected ObjectGenerator |
makeGenerator()
Factory method to produce a suitably customised ObjectGenerator. |
protected java.util.List<TestSequence> |
nextCycle(java.util.List<TestSequence> oldCycle)
Creates a subsequent test set, consisting of TestSequences from the previous cycle which have been extended with every Method in the test class's public interface. |
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 Oracle oracle
protected SummaryReport summary
Constructor Detail |
---|
public ProtocolWalker(Settings settings, Channels channels)
settings
- the test parameter settings to use.channels
- the call-back channels to report on.Method Detail |
---|
protected boolean isPrunable(TestSequence sequence)
sequence
- the TestSequence being evaluated.
protected ObjectGenerator makeGenerator() throws PermissionException
PermissionException
- if any custom generator could not be
instantiated, either for reasons of security, or visibility, or
because it was abstract, or an interface.protected void ensureExecutable() throws PermissionException
PermissionException
- if the loaded test class could not be
instantiated, either for reasons of security, or visibility, or
because it was abstract, or an interface.protected java.util.List<TestSequence> firstCycle()
protected java.util.List<TestSequence> nextCycle(java.util.List<TestSequence> oldCycle)
oldCycle
- the test set from the previous cycle.
protected void executeTestCycle(java.util.List<TestSequence> testSet, int cycle) throws PermissionException, GeneratorException, ExecutionException
testSet
- the test set for the current test cycle.cycle
- the current test cycle number, 0..n.
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 executeTestSeries() 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 ClassInspector
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 |