org.jwalk
Class ExecutionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jwalk.JWalkException
              extended by org.jwalk.ExecutionException
All Implemented Interfaces:
java.io.Serializable

public class ExecutionException
extends JWalkException

ExecutionException signals when a test sequence did not execute properly. This exception may be raised if a given operation was wrongly invoked, for example, because the exercised constructor or method was non-public, or abstract, or was given the wrong argument values. It may also be raised if a test sequence is found to behave randomly, since JWalk requires tested software to behave deterministically (otherwise it cannot learn the expected outcomes). The exception may be queried before it is handled, to support giving different feedback. If invocationFailed() is true, an operation in the sequence was incorrectly invoked. If executionFailed() is true, an operation in the sequence behaved randomly.

Version:
1.1
Author:
Anthony Simons
See Also:
Serialized Form

Constructor Summary
ExecutionException(java.lang.reflect.Member operation)
          Creates an ExecutionException for a given operation.
ExecutionException(java.lang.reflect.Member operation, boolean random)
          Creates an ExecutionException for a given operation, which behaved unpredictably when it was executed.
ExecutionException(java.lang.reflect.Member operation, java.lang.String message)
          Creates an ExecutionException with a specific message, for a given operation.
 
Method Summary
 boolean executionFailed()
          Reports that the operation behaved unpredictably.
 java.lang.reflect.Member getOperation()
          Returns the operation that failed to execute.
 boolean invocationFailed()
          Reports that the operation was not properly invoked.
 
Methods inherited from class org.jwalk.JWalkException
getError
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecutionException

public ExecutionException(java.lang.reflect.Member operation)
Creates an ExecutionException for a given operation.

Parameters:
operation - a Constructor or Method.

ExecutionException

public ExecutionException(java.lang.reflect.Member operation,
                          java.lang.String message)
Creates an ExecutionException with a specific message, for a given operation.

Parameters:
operation - a Constructor or Method.
message - a specific error message.

ExecutionException

public ExecutionException(java.lang.reflect.Member operation,
                          boolean random)
Creates an ExecutionException for a given operation, which behaved unpredictably when it was executed.

Parameters:
operation - a Constructor or Method.
random - a flag indicating non-deterministic behaviour.
Method Detail

getOperation

public java.lang.reflect.Member getOperation()
Returns the operation that failed to execute.

Returns:
the failed operation, or null.

invocationFailed

public boolean invocationFailed()
Reports that the operation was not properly invoked.


executionFailed

public boolean executionFailed()
Reports that the operation behaved unpredictably.