object AssertUtil
This module contains additional higher-level assert statements that are ultimately based on junit.Assert primitives.
- Source
- AssertUtil.scala
- Alphabetic
- By Inheritance
- AssertUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assert8(b: => Boolean, msg: => Any): Unit
Assert on Java 8, but on later versions, just print if assert would fail.
- def assertNotReachable[A <: AnyRef](a: => A, roots: AnyRef*)(body: => Unit): Unit
Value is not strongly reachable from roots after body is evaluated.
- def assertSameElements[A, B >: A](expected: Iterable[A], actual: IterableOnce[B]): Unit
Convenient for testing iterators.
- def assertSameElements[A, B >: A](expected: Iterable[A], actual: Iterable[B], message: String = ""): Unit
JUnit-style assertion for
IterableLike.sameElements. - def assertThrown[T <: Throwable](checker: (T) => Boolean)(body: => Any)(implicit arg0: ClassTag[T]): Unit
- def assertThrows[T <: Throwable](body: => Any, checkMessage: (String) => Boolean = s => true)(implicit arg0: ClassTag[T]): Unit
Check that throwable T (or a subclass) was thrown during evaluation of
body, and that its message satisfies thecheckMessagepredicate.Check that throwable T (or a subclass) was thrown during evaluation of
body, and that its message satisfies thecheckMessagepredicate. Any other exception is propagated. - def assertZeroNetThreads[A](group: ThreadGroup)(body: => A): Try[A]
- def assertZeroNetThreads(body: => Unit): Unit
Assert no new threads, with some margin for arbitrary threads to exit.
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def readyOrNot(awaitable: Awaitable[_]): Boolean
Like Await.ready but return false on timeout, true on completion, throw InterruptedException.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def waitForIt(terminated: => Boolean, progress: Progress = Fast, label: => String = "test"): Unit
Wait for a condition, with a simple back-off strategy.
Wait for a condition, with a simple back-off strategy.
This makes it easier to see hanging threads in development without tweaking a timeout parameter. Conversely, when a thread fails to make progress in a test environment, we allow the wait period to grow larger than usual, since a long wait for failure is acceptable.
It would be nicer if what we're waiting for gave us a progress indicator: we don't care if something takes a long time, so long as we can verify progress.
- def withoutATrace[A](body: => A): NoTrace[A]
- object Fast extends Progress with Product with Serializable
- object Slow extends Progress with Product with Serializable