Package randoop.test

Class EmptyExceptionCheck

java.lang.Object
randoop.test.ExceptionCheck
randoop.test.EmptyExceptionCheck
All Implemented Interfaces:
Check

public class EmptyExceptionCheck extends ExceptionCheck
An ExceptionCheck that doesn't enforce the expectation of an exception by the statement at the statement index. Allows for execution of the statement to be either normal or throw an exception.
  • Constructor Details

    • EmptyExceptionCheck

      EmptyExceptionCheck(Throwable exception, int statementIndex, String catchClassName)
      Creates an exception check for the given statement index.
      Parameters:
      exception - the exception thrown by statement
      statementIndex - the position of statement in sequence
      catchClassName - the name of the exception class to be caught
  • Method Details

    • appendCatchBehavior

      protected void appendCatchBehavior(StringBuilder b)
      Appends code for catch block behavior corresponding to expected exception.

      Appends comment indicating that catch is being ignored.

      Specified by:
      appendCatchBehavior in class ExceptionCheck
      Parameters:
      b - the string builder to which code text is to be added
    • appendTryBehavior

      protected void appendTryBehavior(StringBuilder b)
      Appends code to follow the statement throwing expected exception in try block.

      Appends comment indicating that failure to throw exception being ignored.

      Specified by:
      appendTryBehavior in class ExceptionCheck
      Parameters:
      b - the string builder to which code text is added