Package org.jmock

Class AbstractExpectations

    • Field Detail

      • with

        protected final WithClause with
        Syntactic sugar for specifying arguments that are matchers for primitive types or are untyped matchers.
    • Constructor Detail

      • AbstractExpectations

        public AbstractExpectations()
    • Method Detail

      • one

        public <T> T one​(T mockObject)
        Deprecated.
        Use oneOf instead.
        Specified by:
        one in interface CardinalityClause
      • addParameterMatcher

        protected void addParameterMatcher​(org.hamcrest.Matcher<?> matcher)
      • with

        public <T> T with​(org.hamcrest.Matcher<T> matcher)
        For Matchers with primitive types use the with field, for example:
        with.intIs(equalTo(34));
        For untyped matchers use:
        with.<T>is(equalTo(anObject));
        Specified by:
        with in interface ArgumentConstraintPhrases
      • with

        public boolean with​(boolean value)
      • with

        public byte with​(byte value)
      • with

        public short with​(short value)
      • with

        public char with​(char value)
      • with

        public int with​(int value)
      • with

        public long with​(long value)
      • with

        public float with​(float value)
      • with

        public double with​(double value)
      • with

        public <T> T with​(T value)
      • equal

        public static <T> org.hamcrest.Matcher<T> equal​(T value)
      • same

        public static <T> org.hamcrest.Matcher<T> same​(T value)
      • any

        public static <T> org.hamcrest.Matcher<T> any​(Class<T> type)
      • anything

        public static <T> org.hamcrest.Matcher<T> anything()
      • aNull

        public static <T> org.hamcrest.Matcher<T> aNull​(Class<T> type)
      • aNonNull

        public static <T> org.hamcrest.Matcher<T> aNonNull​(Class<T> type)
      • returnValue

        public static Action returnValue​(Object result)
      • throwException

        public static Action throwException​(Throwable throwable)
      • returnIterator

        public static Action returnIterator​(Collection<?> collection)
      • returnIterator

        public static <T> Action returnIterator​(T... items)
      • returnEnumeration

        public static Action returnEnumeration​(Collection<?> collection)
      • returnEnumeration

        public static <T> Action returnEnumeration​(T... items)
      • onConsecutiveCalls

        public static Action onConsecutiveCalls​(Action... actions)
      • then

        public void then​(State state)
      • inSequence

        public void inSequence​(Sequence sequence)
      • inSequences

        public void inSequences​(Sequence... sequences)