Class BaseExpectations

  • All Implemented Interfaces:
    org.jmock.internal.ExpectationBuilder, org.jmock.syntax.ActionClause, org.jmock.syntax.ArgumentConstraintPhrases, org.jmock.syntax.CardinalityClause
    Direct Known Subclasses:
    BaseTestCase

    public abstract class BaseExpectations
    extends org.jmock.Expectations
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.jmock.Mockery context  
      protected static org.slf4j.Logger LOG  
      protected boolean showAllExpectations  
      • Fields inherited from class org.jmock.Expectations

        with
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void after()  
      org.jmock.syntax.ReceiverClause atLeast​(int count)  
      org.jmock.syntax.ReceiverClause atMost​(int count)  
      void before()  
      org.jmock.syntax.ReceiverClause between​(int minCount, int maxCount)  
      protected static <T> org.hamcrest.Matcher<T[]> contains​(T... expected)  
      protected static <T> org.hamcrest.Matcher<T[]> doseNotContain​(T... forbiddenValues)  
      org.jmock.syntax.ReceiverClause exactly​(int count)  
      protected org.jmock.internal.InvocationExpectationBuilder getCurrentBuilder()  
      protected void ret​(java.lang.Object result)  
      protected void retField​(java.lang.Object container, java.lang.String fieldName)  
      protected void rethrow​(java.lang.Throwable throwable)  
      protected void retMethod​(java.lang.String methodName)  
      protected void rets​(java.lang.Object... results)  
      static org.jmock.api.Action returnValues​(java.lang.Object... result)  
      protected static <T> org.hamcrest.Matcher<T[]> sameArbitraryArray​(T... expectedArr)  
      protected <T> T wany​(java.lang.Class<T> type)  
      protected boolean wanybool()  
      protected int wanyint()  
      protected long wanylong()  
      protected boolean weq​(boolean instance)  
      protected int weq​(int instance)  
      protected long weq​(long instance)  
      protected short weq​(short instance)  
      protected <T> T weq​(T instance)  
      protected <T> T wsame​(T instance)  
      java.lang.String[] wStrArr​(java.lang.Object... expected)  
      • Methods inherited from class org.jmock.Expectations

        a, allowing, allowing, an, aNonNull, aNull, any, anything, buildExpectations, currentBuilder, doAll, equal, ignoring, ignoring, inSequence, inSequences, never, onConsecutiveCalls, one, oneOf, returnEnumeration, returnEnumeration, returnIterator, returnIterator, returnValue, same, then, throwException, when, will, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • context

        protected org.jmock.Mockery context
      • showAllExpectations

        protected boolean showAllExpectations
      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • BaseExpectations

        public BaseExpectations()
    • Method Detail

      • before

        public void before()
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • after

        public void after()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ret

        protected final void ret​(java.lang.Object result)
      • rethrow

        protected final void rethrow​(java.lang.Throwable throwable)
      • retField

        protected final void retField​(java.lang.Object container,
                                      java.lang.String fieldName)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • rets

        protected final void rets​(java.lang.Object... results)
      • wany

        protected final <T> T wany​(java.lang.Class<T> type)
      • wanyint

        protected final int wanyint()
      • wanylong

        protected final long wanylong()
      • wanybool

        protected final boolean wanybool()
      • wsame

        protected final <T> T wsame​(T instance)
      • weq

        protected final <T> T weq​(T instance)
      • weq

        protected final short weq​(short instance)
      • weq

        protected final int weq​(int instance)
      • weq

        protected final long weq​(long instance)
      • weq

        protected final boolean weq​(boolean instance)
      • returnValues

        public static org.jmock.api.Action returnValues​(java.lang.Object... result)
      • retMethod

        protected void retMethod​(java.lang.String methodName)
      • contains

        @SafeVarargs
        protected static final <T> org.hamcrest.Matcher<T[]> contains​(T... expected)
      • sameArbitraryArray

        @SafeVarargs
        protected static final <T> org.hamcrest.Matcher<T[]> sameArbitraryArray​(T... expectedArr)
      • doseNotContain

        @SafeVarargs
        protected static final <T> org.hamcrest.Matcher<T[]> doseNotContain​(T... forbiddenValues)
      • wStrArr

        public final java.lang.String[] wStrArr​(java.lang.Object... expected)
        Parameters:
        expected - null are considered "any"
      • getCurrentBuilder

        protected org.jmock.internal.InvocationExpectationBuilder getCurrentBuilder()
      • exactly

        public org.jmock.syntax.ReceiverClause exactly​(int count)
        Specified by:
        exactly in interface org.jmock.syntax.CardinalityClause
        Overrides:
        exactly in class org.jmock.Expectations
      • atLeast

        public org.jmock.syntax.ReceiverClause atLeast​(int count)
        Specified by:
        atLeast in interface org.jmock.syntax.CardinalityClause
        Overrides:
        atLeast in class org.jmock.Expectations
      • between

        public org.jmock.syntax.ReceiverClause between​(int minCount,
                                                       int maxCount)
        Specified by:
        between in interface org.jmock.syntax.CardinalityClause
        Overrides:
        between in class org.jmock.Expectations
      • atMost

        public org.jmock.syntax.ReceiverClause atMost​(int count)
        Specified by:
        atMost in interface org.jmock.syntax.CardinalityClause
        Overrides:
        atMost in class org.jmock.Expectations