Top Description Fields Constructors Methods
org.testng

public Class SkipException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
org.testng.TimeBombSkipException
Imports
org.testng.internal.AutoCloseableLock

The root exception for special skip handling. In case a @Test or @Configuration throws this exception the method will be considered a skip or a failure according to the return of isSkip(). Users may provide extensions to this mechanism by extending this class.
Since
5.6

Field Summary

Modifier and TypeField and Description
private final AutoCloseableLock
private volatile boolean
private StackTraceElement[]
private static final long

Constructor Summary

AccessConstructor and Description
public
SkipException(String skipMessage)

public
SkipException(String skipMessage, Throwable cause)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the method should be considered a skip, false if the method should be considered failed. If not overwritten it returns true
isSkip
()

Flag if the current exception marks a skipped method (true) or a failure ( false).

protected void
reduceStackTrace()

Subclasses may use this method to reduce the printed stack trace.

protected void
restoreStackTrace()

Restores the original exception stack trace after a previous call to reduceStackTrace().

Field Detail

internalLockback to summary
private final AutoCloseableLock internalLock
m_stackReducedback to summary
private volatile boolean m_stackReduced
m_stackTraceback to summary
private StackTraceElement[] m_stackTrace
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

SkipExceptionback to summary
public SkipException(String skipMessage)
SkipExceptionback to summary
public SkipException(String skipMessage, Throwable cause)

Method Detail

isSkipback to summary
public boolean isSkip()

Flag if the current exception marks a skipped method (true) or a failure ( false). By default Subclasses should override this method in order to provide smarter behavior.

Returns:boolean

true if the method should be considered a skip, false if the method should be considered failed. If not overwritten it returns true

reduceStackTraceback to summary
protected void reduceStackTrace()

Subclasses may use this method to reduce the printed stack trace. This method keeps only the last frame

Important Note

after calling this method the preserved internally and can be restored called restoreStackTrace.

restoreStackTraceback to summary
protected void restoreStackTrace()

Restores the original exception stack trace after a previous call to reduceStackTrace().