Package org.apache.pekko.testkit
Class ErrorFilter
java.lang.Object
org.apache.pekko.testkit.EventFilter
org.apache.pekko.testkit.ErrorFilter
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
Filter which matches Error events, if they satisfy the given criteria:
throwableapplies an upper bound on the type of exception contained in the Error eventsource, if given, applies a filter on the event’s originmessageapplies a filter on the event’s message (either with String.startsWith or Regex.findFirstIn().isDefined); if the message itself does not match, the match is retried with the contained Exception’s message; if both arenull, the filter always matches if at the same time the Exception’s stack trace is empty (this catches JVM-omitted “fast-throw” exceptions)
Left("").- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionErrorFilter(Class<?> throwable) Java API: filter only on the given type of exceptionErrorFilter(Class<?> throwable, String source, String message, boolean pattern, boolean complete, int occurrences) Java API: create an ErrorFilterErrorFilter(Class<?> throwable, scala.Option<String> source, scala.util.Either<String, scala.util.matching.Regex> message, boolean complete, int occurrences) -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorFilterapply(Class<?> throwable, scala.Option<String> source, scala.util.Either<String, scala.util.matching.Regex> message, boolean complete, int occurrences) booleanbooleancomplete()copy(Class<?> throwable, scala.Option<String> source, scala.util.Either<String, scala.util.matching.Regex> message, boolean complete, int occurrences) Class<?>scala.Option<String>scala.util.Either<String,scala.util.matching.Regex> booleanbooleaninthashCode()booleanmatches(Logging.LogEvent event) This method decides whether to filter the event (true) or not (false).scala.util.Either<String,scala.util.matching.Regex> message()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>scala.Option<String>source()Class<?>toString()static scala.Option<scala.Tuple4<Class<?>,scala.Option<String>, scala.util.Either<String, scala.util.matching.Regex>, Object>> unapply(ErrorFilter x$0) Methods inherited from class org.apache.pekko.testkit.EventFilter
apply, apply$default$1, apply$default$2, apply$default$3, apply$default$4, apply$default$5, assertDone, awaitDone, custom, custom$default$2, debug, debug$default$1, debug$default$2, debug$default$3, debug$default$4, debug$default$5, doMatch, error, error$default$1, error$default$2, error$default$3, error$default$4, error$default$5, info, info$default$1, info$default$2, info$default$3, info$default$4, info$default$5, intercept, warning, warning$default$1, warning$default$2, warning$default$3, warning$default$4, warning$default$5Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
ErrorFilter
-
ErrorFilter
public ErrorFilter(Class<?> throwable, String source, String message, boolean pattern, boolean complete, int occurrences) Java API: create an ErrorFilter- Parameters:
source- apply this filter only to events from the given source; do not filter on source if this is given asnullmessage- apply this filter only to events whose message matches; do not filter on message if this is given asnullpattern- iffalse, the message string must start with the given string, otherwise themessageargument is treated as regular expression which is matched against the message (may match only a substring to filter)complete- whether the event’s message must match the given message string or pattern completely
-
ErrorFilter
Java API: filter only on the given type of exception
-
-
Method Details
-
apply
public static ErrorFilter apply(Class<?> throwable, scala.Option<String> source, scala.util.Either<String, scala.util.matching.Regex> message, boolean complete, int occurrences) -
unapply
public static scala.Option<scala.Tuple4<Class<?>,scala.Option<String>, unapplyscala.util.Either<String, scala.util.matching.Regex>, Object>> (ErrorFilter x$0) -
throwable
-
source
- Overrides:
sourcein classEventFilter
-
message
- Overrides:
messagein classEventFilter
-
complete
public boolean complete()- Overrides:
completein classEventFilter
-
matches
Description copied from class:EventFilterThis method decides whether to filter the event (true) or not (false).- Specified by:
matchesin classEventFilter
-
copy
public ErrorFilter copy(Class<?> throwable, scala.Option<String> source, scala.util.Either<String, scala.util.matching.Regex> message, boolean complete, int occurrences) -
copy$default$1
-
copy$default$2
-
copy$default$3
-
copy$default$4
public boolean copy$default$4() -
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-