|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.JWalker
public class JWalker
JWalker is the top-level API class through which third-party software
communicates with the different lazy systematic unit testing
algorithms for unit testing Java classes. JWalker contains two other
component APIs: the Settings API allows testers to set up the desired
test parameters, such as the test class, the test strategy to follow and
the maximum depth of exploration; while the Channels API allows the tester
to register third-party objects with JWalker, to which all test results
and queries will be dispatched.
A test session begins by creating an instance of JWalker, accessing the
Channels API to set up communication channels, then accessing the Settings
API to set up the test parameters. These channels and settings may persist
over several runs of the JWalker, unless modified by the tester. To start
testing, invoke this JWalker's execute()
method. To start
testing in the background, create a new Thread wrapping this JWalker and
invoke the Thread's start()
method. That's all there is to
it. Consult the Settings and Channels APIs for further details.
Field Summary | |
---|---|
protected Channels |
channels
The Channels API supports registering listeners. |
protected Settings |
settings
The Settings API supports supplying test parameters. |
Constructor Summary | |
---|---|
|
JWalker()
Creates a JWalker, ready to use. |
protected |
JWalker(Settings settings,
Channels channels)
Secretly initialises the settings and channels. |
Method Summary | |
---|---|
void |
execute()
Executes this JWalker as a single-threaded application. |
Channels |
getChannels()
Returns the Channels API, to enable setting call-back channels. |
Settings |
getSettings()
Returns the Settings API, to enable setting test parameters. |
java.lang.Class<?> |
getTestClass()
Returns the test class. |
boolean |
outOfMemory()
Reports whether Java ran out of heap memory during the execution of this JWalker engine. |
void |
run()
Executes this JWalker inside a recently-started worker Thread. |
boolean |
userAborted()
Reports whether the user aborted the execution of this JWalker engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Settings settings
protected Channels channels
Constructor Detail |
---|
public JWalker()
protected JWalker(Settings settings, Channels channels)
Method Detail |
---|
public Settings getSettings()
public Channels getChannels()
public java.lang.Class<?> getTestClass()
public void execute() throws PermissionException, GeneratorException, ExecutionException
execute()
.
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 run()
execute()
method, except that it must handle the three declared exceptions, in
order to be compatible with the signature for run()
in the
interface Runnable
. Any raised exceptions are therefore
wrapped inside Notifications, which are dispatched to the channels, to
be unpacked later by the client application.
run
in interface java.lang.Runnable
public boolean outOfMemory()
public boolean userAborted()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |