org.scalatest

trait StackDepth

[source: org/scalatest/StackDepth.scala]

trait StackDepth
extends AnyRef
Trait that encapsulates the information required of an exception thrown by ScalaTest's assertions and matchers, which includes a stack depth at which the failing line of test code resides.

This trait exists so that it can be mixed into two exception superclasses, StackDepthException, from which extend several exceptions that do not depend on JUnit, and JUnitTestFailedError, which does depend on JUnit. The latter, which requires JUnit be in the classpath, ensures failed ScalaTest assertions are reported as "failures," not "errors," by JUnit.

Direct Known Subclasses:
StackDepthException, JUnitTestFailedError

Value Summary
abstract val cause : scala.Option[java.lang.Throwable]
An optional cause, the Throwable that caused this StackDepth exception to be thrown.
val failedCodeFileNameAndLineNumberString : scala.Option[java.lang.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.
abstract val failedCodeStackDepth : Int
The depth in the stack trace of this exception at which the line of test code that failed resides.
abstract val message : scala.Option[java.lang.String]
An optional detail message for this StackDepth exception.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
abstract val message : scala.Option[java.lang.String]
An optional detail message for this StackDepth exception.

abstract val cause : scala.Option[java.lang.Throwable]
An optional cause, the Throwable that caused this StackDepth exception to be thrown.

abstract val failedCodeStackDepth : Int
The depth in the stack trace of this exception at which the line of test code that failed resides.

val failedCodeFileNameAndLineNumberString : scala.Option[java.lang.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.
Returns
a user-presentable string containing the filename and line number that caused the failed test


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