Lines Matching refs:callCount
149 public static <T> T verify(T mock, CallCount howManyTimes) {
181 private static <T> T verify(T mock, CallCount howManyTimes, OrderChecker orderCounter) {
197 private static List<CallCount> sUnfinishedCallCounts = new ArrayList<CallCount>();
245 /** Creates a {@link CallCount} that matches exactly the given number of calls. */
246 public static CallCount times(long n) { return new CallCount(n, n); }
253 /** Creates a {@link CallCount} that only matches if the method was never called. */
254 public static CallCount never() { return new CallCount(0, 0); }
256 /** Creates a {@link CallCount} that matches at least one method call. */
257 public static CallCount atLeastOnce() { return new CallCount(1, Long.MAX_VALUE); }
259 /** Creates a {@link CallCount} that matches any number of method calls, including none at all. */
260 public static CallCount anyTimes() { return new CallCount(0, Long.MAX_VALUE); }
262 /** Creates a {@link CallCount} that matches at least the given number of calls. */
263 public static CallCount atLeast(long n) { return new CallCount(n, Long.MAX_VALUE); }
265 /** Creates a {@link CallCount} that matches up to the given number of calls but no more. */
266 public static CallCount atMost(long n) { return new CallCount(0, n); }
268 /** Creates a {@link CallCount} that matches any number of calls between the two given bounds. */
269 public static CallCount between(long lower, long upper) { return new CallCount(lower, upper); }
623 private CallCount mHowManyTimes = null;
848 Object proxy, StackTraceElement callSite, CallCount callCount, OrderChecker orderCounter) {
851 long callTimeout = callCount.getTimeout();
855 while (!callCount.matches(calls.size())) {
862 fail(formatFailedVerifyMessage(methodCall, calls.size(), callTimeout, callCount));
869 } else if (!callCount.matches(calls.size())) {
870 fail(formatFailedVerifyMessage(methodCall, calls.size(), 0, callCount));
892 CallCount callCount) {
894 sb.append("\nExpected ").append(callCount);
1002 private static class CallCount {
1006 public CallCount(long lowerBound, long upperBound) {
1021 public CallCount setLowerBound(long lowerBound) {
1026 public CallCount setUpperBound(long upperBound) {
1043 public static final class Timeout extends CallCount {
1056 public CallCount times(int times) { return setLowerBound(times).setUpperBound(times); }
1057 public CallCount atLeast(long n) { return setLowerBound(n).setUpperBound(Long.MAX_VALUE); }
1058 public CallCount atLeastOnce() { return setLowerBound(1).setUpperBound(Long.MAX_VALUE); }
1059 public CallCount between(long n, long m) { return setLowerBound(n).setUpperBound(m); }