Package org.junit.internal
Class AssumptionViolatedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.junit.internal.AssumptionViolatedException
-
- All Implemented Interfaces:
java.io.Serializable,org.hamcrest.SelfDescribing
- Direct Known Subclasses:
AssumptionViolatedException
public class AssumptionViolatedException extends java.lang.RuntimeException implements org.hamcrest.SelfDescribingAn exception class used to implement assumptions (state in which a given test is meaningful and should or should not be executed). A test for which an assumption fails should not generate a test case failure.- See Also:
Assume, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringfAssumptionprivate org.hamcrest.Matcher<?>fMatcherprivate java.lang.ObjectfValueprivate booleanfValueMatcherprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description AssumptionViolatedException(java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.AssumptionViolatedException(java.lang.String assumption)Deprecated.Please useAssumptionViolatedExceptioninstead.AssumptionViolatedException(java.lang.String assumption, boolean hasValue, java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.AssumptionViolatedException(java.lang.String assumption, java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.AssumptionViolatedException(java.lang.String assumption, java.lang.Throwable e)Deprecated.Please useAssumptionViolatedExceptioninstead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddescribeTo(org.hamcrest.Description description)java.lang.StringgetMessage()private voidwriteObject(java.io.ObjectOutputStream objectOutputStream)Override default Java object serialization to correctly deal with potentially unserializable matchers or values.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
fAssumption
private final java.lang.String fAssumption
-
fValueMatcher
private final boolean fValueMatcher
-
fValue
private final java.lang.Object fValue
-
fMatcher
private final org.hamcrest.Matcher<?> fMatcher
-
-
Constructor Detail
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(java.lang.String assumption, boolean hasValue, java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.An assumption exception with the given value (String or Throwable) and an additional failingMatcher.
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(java.lang.String assumption, java.lang.Object value, org.hamcrest.Matcher<?> matcher)Deprecated.Please useAssumptionViolatedExceptioninstead.An assumption exception with the given value (String or Throwable) and an additional failingMatcher.
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(java.lang.String assumption)
Deprecated.Please useAssumptionViolatedExceptioninstead.An assumption exception with the given message only.
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(java.lang.String assumption, java.lang.Throwable e)Deprecated.Please useAssumptionViolatedExceptioninstead.An assumption exception with the given message and a cause.
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessagein classjava.lang.Throwable
-
describeTo
public void describeTo(org.hamcrest.Description description)
- Specified by:
describeToin interfaceorg.hamcrest.SelfDescribing
-
writeObject
private void writeObject(java.io.ObjectOutputStream objectOutputStream) throws java.io.IOExceptionOverride default Java object serialization to correctly deal with potentially unserializable matchers or values. By not implementing readObject, we assure ourselves of backwards compatibility and compatibility with the standard way of Java serialization.- Parameters:
objectOutputStream- The outputStream to write our representation to- Throws:
java.io.IOException- When serialization fails
-
-