Package randoop.test

Class InvalidChecks

java.lang.Object
randoop.test.InvalidChecks
All Implemented Interfaces:
TestChecks<InvalidChecks>

public class InvalidChecks extends Object implements TestChecks<InvalidChecks>
An empty or singleton set. It contains at most one InvalidExceptionCheck or InvalidValueCheck, which captures invalid behavior in a sequence.
  • Field Details

    • EMPTY

      public static final InvalidChecks EMPTY
      An empty, immutable set of invalid checks.
    • check

      private Check check
  • Constructor Details

    • InvalidChecks

      public InvalidChecks()
      Create an empty, mutable set of invalid checks.
    • InvalidChecks

      public InvalidChecks(Check check)
      Create a singleton set of invalid checks.
      Parameters:
      check - the sole member of the newly-created singleton set
  • Method Details

    • count

      public int count()
      Description copied from interface: TestChecks
      Return the number of checks in this test.
      Specified by:
      count in interface TestChecks<InvalidChecks>
      Returns:
      the count of checks in this object
    • checks

      public Set<Check> checks()
      Description copied from interface: TestChecks
      Get all non-exception checks and whether they are passing for this object.
      Specified by:
      checks in interface TestChecks<InvalidChecks>
      Returns:
      all checks with passing status
    • hasChecks

      public boolean hasChecks()
      Description copied from interface: TestChecks
      Indicates whether this object has checks.
      Specified by:
      hasChecks in interface TestChecks<InvalidChecks>
      Returns:
      true if this object has checks, false otherwise
    • hasErrorBehavior

      public boolean hasErrorBehavior()
      Description copied from interface: TestChecks
      Indicate whether this object has any failing checks. (This is essentially asking whether this is an error revealing test.)
      Specified by:
      hasErrorBehavior in interface TestChecks<InvalidChecks>
      Returns:
      true if this object has failing checks, false otherwise
    • getExceptionCheck

      public ExceptionCheck getExceptionCheck()
      Description copied from interface: TestChecks
      Return the exception check in this object if there is one.
      Specified by:
      getExceptionCheck in interface TestChecks<InvalidChecks>
      Returns:
      the expected exception check, null otherwise
    • add

      public void add(Check check)
      Description copied from interface: TestChecks
      Add a check to this set.
      Specified by:
      add in interface TestChecks<InvalidChecks>
      Parameters:
      check - the check object to add to this set of checks
    • commonChecks

      public InvalidChecks commonChecks(InvalidChecks other)
      Description copied from interface: TestChecks
      Returns the intersection of checks in this set and another set.
      Specified by:
      commonChecks in interface TestChecks<InvalidChecks>
      Parameters:
      other - the TestChecks to compare with
      Returns:
      the checks common to this set of checks and those in other
    • hasInvalidBehavior

      public boolean hasInvalidBehavior()
      Description copied from interface: TestChecks
      Indicates whether this set of checks contains any invalid behaviors.
      Specified by:
      hasInvalidBehavior in interface TestChecks<InvalidChecks>
      Returns:
      true when this contains checks for invalid behavior, false otherwise