Package org.testng
Class SkipException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.testng.SkipException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
TimeBombSkipException
public class SkipException extends java.lang.RuntimeExceptionThe 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 ofisSkip(). Users may provide extensions to this mechanism by extending this class.- Since:
- 5.6
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleanm_stackReducedprivate java.lang.StackTraceElement[]m_stackTraceprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SkipException(java.lang.String skipMessage)SkipException(java.lang.String skipMessage, java.lang.Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSkip()Flag if the current exception marks a skipped method (true) or a failure (false).protected voidreduceStackTrace()Subclasses may use this method to reduce the printed stack trace.protected voidrestoreStackTrace()Restores the original exception stack trace after a previous call toreduceStackTrace().
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_stackTrace
private java.lang.StackTraceElement[] m_stackTrace
-
m_stackReduced
private volatile boolean m_stackReduced
-
-
Method Detail
-
isSkip
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:
trueif the method should be considered a skip,falseif the method should be considered failed. If not overwritten it returnstrue
-
reduceStackTrace
protected void reduceStackTrace()
Subclasses may use this method to reduce the printed stack trace. This method keeps only the last frame. Important: after calling this method the preserved internally and can be restored calledrestoreStackTrace().
-
restoreStackTrace
protected void restoreStackTrace()
Restores the original exception stack trace after a previous call toreduceStackTrace().
-
-