randoop
Class ExpectedExceptionCheck

Object
  extended by ExpectedExceptionCheck
All Implemented Interfaces:
Serializable, Check

public class ExpectedExceptionCheck
extends Object
implements Check

A checker that checks for an expected exception from a method call.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
ExpectedExceptionCheck(Class<? extends Throwable> exception_class, int statementIdx)
           
ExpectedExceptionCheck(Throwable exception, int statementIdx)
           
 
Method Summary
Modifier and Type Method and Description
 boolean equals(Object o)
           
 boolean evaluate(Execution execution)
          Evaluates this check on the given unfolding execution of a sequence, returning true if the check succeeded, and false otherwise.
 String get_id()
          Returns a unique string identifier for the check.
 int get_stmt_no()
          return the offset of this statement in the sequence
 String get_value()
          Returns the class of the exception thrown
 int hashCode()
           
 String toCodeStringPostStatement()
          The "catch" half of the try-catch wrapper.
 String toCodeStringPreStatement()
          The "try" half of the try-catch wrapper.
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpectedExceptionCheck

public ExpectedExceptionCheck(Throwable exception,
                              int statementIdx)

ExpectedExceptionCheck

public ExpectedExceptionCheck(Class<? extends Throwable> exception_class,
                              int statementIdx)
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

get_id

public String get_id()
Description copied from interface: Check
Returns a unique string identifier for the check. Two checks are the same if these identifers match. The value is NOT included. with. Used to match up checks between the same sequence run at different times. Note that because of changes in the environment (eg, static variables), two executions of the same sequence may have different checks (because the existence of some checks depends on the value of variables)

Specified by:
get_id in interface Check

get_value

public String get_value()
Returns the class of the exception thrown

Specified by:
get_value in interface Check

get_stmt_no

public int get_stmt_no()
return the offset of this statement in the sequence

Specified by:
get_stmt_no in interface Check

toCodeStringPreStatement

public String toCodeStringPreStatement()
The "try" half of the try-catch wrapper.

Specified by:
toCodeStringPreStatement in interface Check

toCodeStringPostStatement

public String toCodeStringPostStatement()
The "catch" half of the try-catch wrapper.

Specified by:
toCodeStringPostStatement in interface Check

evaluate

public boolean evaluate(Execution execution)
Description copied from interface: Check
Evaluates this check on the given unfolding execution of a sequence, returning true if the check succeeded, and false otherwise.

Specified by:
evaluate in interface Check