Package randoop.test

Class MissingExceptionCheck

java.lang.Object
randoop.test.MissingExceptionCheck
All Implemented Interfaces:
Check

public class MissingExceptionCheck extends Object implements Check
Represents the fact that a statement should throw an exception, but did not. It is used in an error-revealing test to indicate that normal execution of the statement violates the stated throws-condition of the method/constructor.
  • Field Details

    • expected

      private final List<List<ThrowsClause>> expected
      The list of lists of throws clauses for which the guard expression was satisfied. Each list of throwsclauses represents one specification, and each such list must be satisfied.
    • index

      private final int index
      The index of the statement where the exception should be thrown.
  • Constructor Details

    • MissingExceptionCheck

      MissingExceptionCheck(List<List<ThrowsClause>> expected, int index)
      Creates a MissingExceptionCheck object for the expected exception type at the given statement.
      Parameters:
      expected - the expected exceptions
      index - the statement index
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toCodeStringPreStatement

      public String toCodeStringPreStatement()
      Description copied from interface: Check
      Returns a string of Java source code to be emitted before a statement containing this check.
      Specified by:
      toCodeStringPreStatement in interface Check
      Returns:
      the string to be included before the statement
    • toCodeStringPostStatement

      public String toCodeStringPostStatement()
      Description copied from interface: Check
      Returns a string of Java source code to be emitted after a statement containing this check.
      Specified by:
      toCodeStringPostStatement in interface Check
      Returns:
      the string to be included following the statement