Class

org.scalatest.mock

JMockExpectations

Related Doc: package mock

Permalink

final class JMockExpectations extends jmock.Expectations

Subclass of org.jmock.Expectations that provides withArg alternatives to the with methods defined in its superclass.

JMockCycle's expecting method of passes an instance of this class to the function passed into expectations. Because JMockExpectations extends org.jmock.Expectations, all of the Expectations methods are available to be invoked on instances of this class, in addition to several overloaded withArg methods defined in this class. These withArg methods simply invoke corresponding with methods on this. Because with is a keyword in Scala, to invoke these directly you must surround them in back ticks, like this:

oneOf (mockCollaborator).documentAdded(`with`("Document"))

By importing the members of the JMockExpectations object passed to a JMockCycle's executing method, you can instead call withArg with no back ticks needed:

oneOf (mockCollaborator).documentAdded(withArg("Document"))

Source
JMockExpectations.scala
Linear Supertypes
jmock.Expectations, ActionClause, ArgumentConstraintPhrases, CardinalityClause, ExpectationBuilder, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JMockExpectations
  2. Expectations
  3. ActionClause
  4. ArgumentConstraintPhrases
  5. CardinalityClause
  6. ExpectationBuilder
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JMockExpectations()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def allowing[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  5. def allowing(arg0: Matcher[_]): MethodClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def atLeast(arg0: Int): ReceiverClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  8. def atMost(arg0: Int): ReceiverClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  9. def between(arg0: Int, arg1: Int): ReceiverClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  10. def buildExpectations(arg0: Action, arg1: ExpectationCollector): Unit

    Permalink
    Definition Classes
    Expectations → ExpectationBuilder
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def currentBuilder(): InvocationExpectationBuilder

    Permalink
    Attributes
    protected[org.jmock]
    Definition Classes
    Expectations
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def exactly(arg0: Int): ReceiverClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. def ignoring(arg0: Matcher[_]): MethodClause

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  20. def ignoring[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  21. def inSequence(arg0: Sequence): Unit

    Permalink
    Definition Classes
    Expectations
  22. def inSequences(arg0: <repeated...>[Sequence]): Unit

    Permalink
    Definition Classes
    Expectations
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. def never[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. def one[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations → CardinalityClause
  29. def oneOf[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def then(arg0: State): Unit

    Permalink
    Definition Classes
    Expectations
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def when(arg0: StatePredicate): Unit

    Permalink
    Definition Classes
    Expectations
  37. def will(arg0: Action): Unit

    Permalink
    Definition Classes
    Expectations → ActionClause
  38. def with[T](arg0: T): T

    Permalink
    Definition Classes
    Expectations
  39. def with(arg0: Double): Double

    Permalink
    Definition Classes
    Expectations
  40. def with(arg0: Float): Float

    Permalink
    Definition Classes
    Expectations
  41. def with(arg0: Long): Long

    Permalink
    Definition Classes
    Expectations
  42. def with(arg0: Int): Int

    Permalink
    Definition Classes
    Expectations
  43. def with(arg0: Char): Char

    Permalink
    Definition Classes
    Expectations
  44. def with(arg0: Short): Short

    Permalink
    Definition Classes
    Expectations
  45. def with(arg0: Byte): Byte

    Permalink
    Definition Classes
    Expectations
  46. def with(arg0: Boolean): Boolean

    Permalink
    Definition Classes
    Expectations
  47. def with(arg0: Matcher[Double]): Double

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  48. def with(arg0: Matcher[Float]): Float

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  49. def with(arg0: Matcher[Long]): Long

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  50. def with(arg0: Matcher[Integer]): Int

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  51. def with(arg0: Matcher[Character]): Char

    Permalink
    Definition Classes
    Expectations
  52. def with(arg0: Matcher[Short]): Short

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  53. def with(arg0: Matcher[Byte]): Byte

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  54. def with(arg0: Matcher[Boolean]): Boolean

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  55. def with[T](arg0: Matcher[T]): T

    Permalink
    Definition Classes
    Expectations → ArgumentConstraintPhrases
  56. def withArg(matcher: Matcher[Char]): Char

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  57. def withArg(matcher: Matcher[Double]): Double

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  58. def withArg(matcher: Matcher[Float]): Float

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  59. def withArg(matcher: Matcher[Boolean]): Boolean

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  60. def withArg(matcher: Matcher[Long]): Long

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  61. def withArg(matcher: Matcher[Byte]): Byte

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  62. def withArg(matcher: Matcher[Short]): Short

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  63. def withArg(matcher: Matcher[Int]): Int

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  64. def withArg[T](matcher: Matcher[T]): T

    Permalink

    Invokes with on this instance, passing in the passed matcher.

    Invokes with on this instance, passing in the passed matcher.

  65. def withArg(value: Char): Char

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  66. def withArg(value: Double): Double

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  67. def withArg(value: Float): Float

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  68. def withArg(value: Boolean): Boolean

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  69. def withArg(value: Long): Long

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  70. def withArg(value: Byte): Byte

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  71. def withArg(value: Short): Short

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  72. def withArg(value: Int): Int

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

  73. def withArg[T](value: T): T

    Permalink

    Invokes with on this instance, passing in the passed value.

    Invokes with on this instance, passing in the passed value.

Inherited from jmock.Expectations

Inherited from ActionClause

Inherited from ArgumentConstraintPhrases

Inherited from CardinalityClause

Inherited from ExpectationBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped