org.scalatest

class TestFailedException

[source: org/scalatest/TestFailedException.scala]

class TestFailedException(message : scala.Option[java.lang.String], cause : scala.Option[java.lang.Throwable], failedCodeStackDepth : Int)
extends StackDepthException
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. (In other words, the user need not scan through the stack trace to find the correct filename and line number of the failing test.)
Parameters
message - an optional detail message for this TestFailedException.
cause - an optional 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.
Throws
NullPointerException - if message is null, or Some(null).
NullPointerException - if cause is null, or Some(null).
Author
Bill Venners
Direct Known Subclasses:
PropertyTestFailedException

Additional Constructor Summary
def this (cause : java.lang.Throwable, failedCodeStackDepth : Int) : TestFailedException
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.
def this (message : java.lang.String, failedCodeStackDepth : Int) : TestFailedException
Create a TestFailedException with a specified stack depth and detail message.
def this (message : java.lang.String, cause : java.lang.Throwable, failedCodeStackDepth : Int) : TestFailedException
Create a TestFailedException with the specified stack depth, detail message, and cause.
def this (failedCodeStackDepth : Int) : TestFailedException
Create a TestFailedException with specified stack depth and no detail message or cause.
Value Summary
val failedTestCodeFileNameAndLineNumberString : scala.Option[java.lang.String]
failedTestCodeFileNameAndLineNumberString has been deprecated and will be removed in a future version of ScalaTest. Please call failedCodeFileNameAndLineNumberString instead.
val failedTestCodeStackDepth : Int
failedTestCodeStackDepth has been deprecated and will be removed in a future version of ScalaTest. Please call failedCodeStackDepth instead.
Values and Variables inherited from StackDepth
failedCodeFileNameAndLineNumberString
Methods inherited from StackDepthException
initCause
Methods inherited from java.lang.Throwable
java.lang.Throwable.getMessage, java.lang.Throwable.getLocalizedMessage, java.lang.Throwable.getCause, java.lang.Throwable.toString, java.lang.Throwable.printStackTrace, java.lang.Throwable.printStackTrace, java.lang.Throwable.printStackTrace, java.lang.Throwable.fillInStackTrace, java.lang.Throwable.getStackTrace, java.lang.Throwable.setStackTrace
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Additional Constructor Details
def this(failedCodeStackDepth : Int) : TestFailedException
Create a TestFailedException with specified stack depth and no detail message or cause.
Parameters
failedCodeStackDepth - the depth in the stack trace of this exception at which the line of test code that failed resides.

def this(message : java.lang.String, failedCodeStackDepth : Int) : TestFailedException
Create a TestFailedException with a specified stack depth and detail message.
Parameters
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.
Throws
NullPointerException - if message is null.

def this(cause : java.lang.Throwable, failedCodeStackDepth : Int) : TestFailedException
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.
Parameters
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.
Throws
NullPointerException - if cause is null.

def this(message : java.lang.String, cause : java.lang.Throwable, failedCodeStackDepth : Int) : TestFailedException
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.

Parameters
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.
Throws
NullPointerException - if message is null.
NullPointerException - if cause is null.

Value Details
@scala.deprecated

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

@scala.deprecated

val failedTestCodeFileNameAndLineNumberString : scala.Option[java.lang.String]
failedTestCodeFileNameAndLineNumberString has been deprecated and will be removed in a future version of ScalaTest. Please call failedCodeFileNameAndLineNumberString instead.


Copyright (C) 2001-2009 Artima, Inc. All rights reserved.