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:
Serializable
,org.hamcrest.SelfDescribing
- Direct Known Subclasses:
AssumptionViolatedException
public class AssumptionViolatedException
extends RuntimeException
implements org.hamcrest.SelfDescribing
An 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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAssumptionViolatedException
(Object value, org.hamcrest.Matcher<?> matcher) Deprecated.AssumptionViolatedException
(String assumption) Deprecated.Please useAssumptionViolatedException
instead.AssumptionViolatedException
(String assumption, boolean hasValue, Object value, org.hamcrest.Matcher<?> matcher) Deprecated.Please useAssumptionViolatedException
instead.AssumptionViolatedException
(String assumption, Object value, org.hamcrest.Matcher<?> matcher) Deprecated.Please useAssumptionViolatedException
instead.AssumptionViolatedException
(String assumption, Throwable e) Deprecated.Please useAssumptionViolatedException
instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) private void
writeObject
(ObjectOutputStream objectOutputStream) Override default Java object serialization to correctly deal with potentially unserializable matchers or values.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
fAssumption
-
fValueMatcher
private final boolean fValueMatcher -
fValue
-
fMatcher
private final org.hamcrest.Matcher<?> fMatcher
-
-
Constructor Details
-
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(String assumption, boolean hasValue, Object value, org.hamcrest.Matcher<?> matcher) Deprecated.Please useAssumptionViolatedException
instead. -
AssumptionViolatedException
Deprecated.Please useAssumptionViolatedException
instead.An assumption exception with the given value (String or Throwable) and an additional failingMatcher
. -
AssumptionViolatedException
@Deprecated public AssumptionViolatedException(String assumption, Object value, org.hamcrest.Matcher<?> matcher) Deprecated.Please useAssumptionViolatedException
instead.An assumption exception with the given value (String or Throwable) and an additional failingMatcher
. -
AssumptionViolatedException
Deprecated.Please useAssumptionViolatedException
instead.An assumption exception with the given message only. -
AssumptionViolatedException
Deprecated.Please useAssumptionViolatedException
instead.An assumption exception with the given message and a cause.
-
-
Method Details
-
getMessage
- Overrides:
getMessage
in classThrowable
-
describeTo
public void describeTo(org.hamcrest.Description description) - Specified by:
describeTo
in interfaceorg.hamcrest.SelfDescribing
-
writeObject
Override 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:
IOException
- When serialization fails
-
AssumptionViolatedException
instead.