org.scalatest.prop

PropertyTestFailedException

class PropertyTestFailedException extends TestFailedException

Exception that indicates a test failed. The purpose of this exception is to encapsulate information about the stack depth at which the line of test code that failed resides, so that information can be presented to the user that makes it quick to find the failing line of test code. (I.e., the user need not scan through the stack trace to find the correct filename and line number of the failing test.)

Inherits

  1. TestFailedException
  2. StackDepthException
  3. StackDepth
  4. RuntimeException
  5. Exception
  6. Throwable
  7. Serializable
  8. AnyRef
  9. Any

Value Members

  1. val args: List[Any]

  2. val cause: Option[Throwable]

    An optional cause, the Throwable that caused this StackDepth exception to be thrown

    An optional cause, the Throwable that caused this StackDepth exception to be thrown.

    definition classes: StackDepthExceptionStackDepth
  3. def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an equivalence relation:

    • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
    • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
    • It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef ⇐ Any
  4. val failedCodeFileNameAndLineNumberString: Option[String]

    A string that provides the filename and line number of the line of code that failed, suitable for presenting to a user, which is taken from this exception's StackTraceElement at the depth specified by failedCodeStackDepth

    A string that provides the filename and line number of the line of code that failed, suitable for presenting to a user, which is taken from this exception's StackTraceElement at the depth specified by failedCodeStackDepth.

    definition classes: StackDepth
  5. val failedCodeStackDepth: Int

    The depth in the stack trace of this exception at which the line of test code that failed resides

    The depth in the stack trace of this exception at which the line of test code that failed resides.

    definition classes: StackDepthExceptionStackDepth
  6. val failedTestCodeFileNameAndLineNumberString: Option[String]

    failedTestCodeFileNameAndLineNumberString has been deprecated and will be removed in a future version of ScalaTest

    failedTestCodeFileNameAndLineNumberString has been deprecated and will be removed in a future version of ScalaTest. Please call failedCodeFileNameAndLineNumberString instead.

    definition classes: TestFailedException
  7. val failedTestCodeStackDepth: Int

    failedTestCodeStackDepth has been deprecated and will be removed in a future version of ScalaTest

    failedTestCodeStackDepth has been deprecated and will be removed in a future version of ScalaTest. Please call failedCodeStackDepth instead.

    definition classes: TestFailedException
  8. def fillInStackTrace(): Throwable

  9. def getCause(): Throwable

  10. def getLocalizedMessage(): String

  11. def getMessage(): String

  12. def getStackTrace(): Array[StackTraceElement]

  13. def hashCode(): Int

    Returns a hash code value for the object

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    definition classes: AnyRef ⇐ Any
  14. val labels: List[String]

  15. val message: Option[String]

    An optional detail message for this StackDepth exception

    An optional detail message for this StackDepth exception.

    definition classes: StackDepthExceptionStackDepth
  16. def printStackTrace(arg0: PrintWriter): Unit

  17. def printStackTrace(arg0: PrintStream): Unit

  18. def printStackTrace(): Unit

  19. def setStackTrace(arg0: Array[StackTraceElement]): Unit

  20. def toString(): String

    Returns a string representation of the object

    Returns a string representation of the object.

    The default representation is platform dependent.

    definition classes: Throwable ⇐ AnyRef ⇐ Any
  21. val undecoratedMessage: String

Instance constructors

  1. new PropertyTestFailedException(message: String, cause: Option[Throwable], failedCodeStackDepth: Int, undecoratedMessage: String, args: List[Any], labels: List[String])

  2. new PropertyTestFailedException(message: String, cause: Throwable, failedCodeStackDepth: Int)

    Create a TestFailedException with the specified stack depth, detail message, and cause

    Create a TestFailedException with the specified stack depth, detail message, and cause.

    Note that the detail message associated with cause is not automatically incorporated in this throwable's detail message.

    message

    A detail message for this TestFailedException.

    cause

    the cause, the Throwable that caused this TestFailedException to be thrown.

    failedCodeStackDepth

    the depth in the stack trace of this exception at which the line of test code that failed resides.

    definition classes: TestFailedException
  3. new PropertyTestFailedException(cause: Throwable, failedCodeStackDepth: Int)

    Create a TestFailedException with the specified stack depth and cause

    Create a TestFailedException with the specified stack depth and cause. The message field of this exception object will be initialized to if (cause.getMessage == null) "" else cause.getMessage.

    cause

    the cause, the Throwable that caused this TestFailedException to be thrown.

    failedCodeStackDepth

    the depth in the stack trace of this exception at which the line of test code that failed resides.

    definition classes: TestFailedException
  4. new PropertyTestFailedException(message: String, failedCodeStackDepth: Int)

    Create a TestFailedException with a specified stack depth and detail message

    Create a TestFailedException with a specified stack depth and detail message.

    message

    A detail message for this TestFailedException.

    failedCodeStackDepth

    the depth in the stack trace of this exception at which the line of test code that failed resides.

    definition classes: TestFailedException
  5. new PropertyTestFailedException(failedCodeStackDepth: Int)

    Create a TestFailedException with specified stack depth and no detail message or cause

    Create a TestFailedException with specified stack depth and no detail message or cause.

    failedCodeStackDepth

    the depth in the stack trace of this exception at which the line of test code that failed resides.

    definition classes: TestFailedException
  6. new PropertyTestFailedException(message: Option[String], cause: Option[Throwable], failedCodeStackDepth: Int)

  7. new PropertyTestFailedException(arg0: Throwable)

  8. new PropertyTestFailedException(arg0: String, arg1: Throwable)

  9. new PropertyTestFailedException(arg0: String)

  10. new PropertyTestFailedException()