Home
last modified time | relevance | path

Searched refs:wanted (Results 1 – 25 of 233) sorted by relevance

12345678910

/external/mockito/src/main/java/org/mockito/internal/matchers/
DArrayEquals.java13 public ArrayEquals(Object wanted) { in ArrayEquals() argument
14 super(wanted); in ArrayEquals()
18 Object wanted = getWanted(); in matches() local
19 if (wanted == null || actual == null) { in matches()
21 } else if (wanted instanceof boolean[] && actual instanceof boolean[]) { in matches()
22 return Arrays.equals((boolean[]) wanted, (boolean[]) actual); in matches()
23 } else if (wanted instanceof byte[] && actual instanceof byte[]) { in matches()
24 return Arrays.equals((byte[]) wanted, (byte[]) actual); in matches()
25 } else if (wanted instanceof char[] && actual instanceof char[]) { in matches()
26 return Arrays.equals((char[]) wanted, (char[]) actual); in matches()
[all …]
DEquals.java15 private final Object wanted; field in Equals
17 public Equals(Object wanted) { in Equals() argument
18 this.wanted = wanted; in Equals()
22 return Equality.areEqual(this.wanted, actual); in matches()
26 return describe(wanted); in toString()
34 return wanted; in getWanted()
43 …return this.wanted == null && other.wanted == null || this.wanted != null && this.wanted.equals(ot… in equals()
52 return "("+ wanted.getClass().getSimpleName() +") " + describe(wanted); in toStringWithType()
56 return wanted != null && target != null && target.getClass() == wanted.getClass(); in typeMatches()
DEqualsWithDelta.java14 private final Number wanted; field in EqualsWithDelta
18 this.wanted = value; in EqualsWithDelta()
23 if (wanted == null ^ actual == null) { in matches()
27 if (wanted == actual) { in matches()
31 return wanted.doubleValue() - delta.doubleValue() <= actual.doubleValue() in matches()
32 && actual.doubleValue() <= wanted.doubleValue() in matches()
37 return "eq(" + wanted + ", " + delta + ")"; in toString()
DSame.java15 private final Object wanted; field in Same
17 public Same(Object wanted) { in Same() argument
18 this.wanted = wanted; in Same()
22 return wanted == actual; in matches()
26 return "same(" + ValuePrinter.print(wanted) + ")"; in toString()
DCompareTo.java13 private final T wanted; field in CompareTo
16 this.wanted = value; in CompareTo()
24 if (!actual.getClass().isInstance(wanted)){ in matches()
28 int result = actual.compareTo(wanted); in matches()
34 return getName() + "(" + wanted + ")"; in toString()
/external/mockito/src/test/java/org/mockitousage/matchers/
DReflectionMatchersTest.java55 Child wanted = new Child(1, "foo", 2, "bar"); in shouldMatchWhenFieldValuesEqual() local
56 verify(mock).run(refEq(wanted)); in shouldMatchWhenFieldValuesEqual()
61 Child wanted = new Child(1, "foo", 2, "bar XXX"); in shouldNotMatchWhenFieldValuesDiffer() local
62 verify(mock).run(refEq(wanted)); in shouldNotMatchWhenFieldValuesDiffer()
67 Child wanted = new Child(1, "foo", 999, "bar"); in shouldNotMatchAgain() local
68 verify(mock).run(refEq(wanted)); in shouldNotMatchAgain()
73 Child wanted = new Child(1, "XXXXX", 2, "bar"); in shouldNotMatchYetAgain() local
74 verify(mock).run(refEq(wanted)); in shouldNotMatchYetAgain()
79 Child wanted = new Child(234234, "foo", 2, "bar"); in shouldNotMatch() local
80 verify(mock).run(refEq(wanted)); in shouldNotMatch()
[all …]
/external/mockito/src/main/java/org/mockito/internal/invocation/
DInvocationsFinder.java23 …static List<Invocation> findInvocations(List<Invocation> invocations, MatchableInvocation wanted) { in findInvocations() argument
24 return ListUtil.filter(invocations, new RemoveNotMatching(wanted)); in findInvocations()
27 …tchingUnverifiedChunks(List<Invocation> invocations, MatchableInvocation wanted, InOrderContext or… in findAllMatchingUnverifiedChunks() argument
29 return ListUtil.filter(unverified, new RemoveNotMatching(wanted)); in findAllMatchingUnverifiedChunks()
47 …ion> findMatchingChunk(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount, … in findMatchingChunk() argument
49 List<Invocation> firstChunk = getFirstMatchingChunk(wanted, unverified); in findMatchingChunk()
52 return findAllMatchingUnverifiedChunks(invocations, wanted, context); in findMatchingChunk()
58 …private static List<Invocation> getFirstMatchingChunk(MatchableInvocation wanted, List<Invocation>… in getFirstMatchingChunk() argument
61 if (wanted.matches(invocation)) { in getFirstMatchingChunk()
70 …ngUnverifiedInvocation(List<Invocation> invocations, MatchableInvocation wanted, InOrderContext co… in findFirstMatchingUnverifiedInvocation() argument
[all …]
DInvocationMarker.java17 public static void markVerified(List<Invocation> invocations, MatchableInvocation wanted) { in markVerified() argument
19 markVerified(invocation, wanted); in markVerified()
23 public static void markVerified(Invocation invocation, MatchableInvocation wanted) { in markVerified() argument
25 wanted.captureArgumentsFrom(invocation); in markVerified()
28 …public static void markVerifiedInOrder(List<Invocation> chunk, MatchableInvocation wanted, InOrder… in markVerifiedInOrder() argument
29 markVerified(chunk, wanted); in markVerifiedInOrder()
/external/mockito/src/test/java/org/mockito/internal/verification/checkers/
DNumberOfInvocationsInOrderCheckerTest.java32 private InvocationMatcher wanted; field in NumberOfInvocationsInOrderCheckerTest
50 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldPassIfWantedIsZeroAndMatchingChunkIsEmpty()
53 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 0, context); in shouldPassIfWantedIsZeroAndMatchingChunkIsEmpty()
58 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldPassIfChunkMatches()
60 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 1, context); in shouldPassIfChunkMatches()
68 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportTooLittleInvocations()
76 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 4, context); in shouldReportTooLittleInvocations()
84 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldMarkAsVerifiedInOrder()
87 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 1, context); in shouldMarkAsVerifiedInOrder()
93 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportTooLittleActual()
[all …]
DNumberOfInvocationsCheckerTest.java34 private InvocationMatcher wanted; field in NumberOfInvocationsCheckerTest
49 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportTooLittleActual()
57 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 100); in shouldReportTooLittleActual()
62 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportWithLastInvocationStackTrace()
71 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 100); in shouldReportWithLastInvocationStackTrace()
77 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldNotReportWithLastInvocationStackTraceIfNoInvocationsFound()
85 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 100); in shouldNotReportWithLastInvocationStackTraceIfNoInvocationsFound()
95 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportWithFirstUndesiredInvocationStackTrace()
99 NumberOfInvocationsChecker.checkNumberOfInvocations(invocations, wanted, 2); in shouldReportWithFirstUndesiredInvocationStackTrace()
108 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportTooManyActual()
[all …]
DMissingInvocationInOrderCheckerTest.java33 private InvocationMatcher wanted; field in MissingInvocationInOrderCheckerTest
55 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldPassWhenMatchingInteractionFound()
57 checkMissingInvocation(invocations, wanted, context); in shouldPassWhenMatchingInteractionFound()
63 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportWantedButNotInvoked()
69 checkMissingInvocation(invocations, wanted, context); in shouldReportWantedButNotInvoked()
75 wanted = buildIntArgMethod().arg(2222).toInvocationMatcher(); in shouldReportArgumentsAreDifferent()
84 checkMissingInvocation(invocations, wanted, context); in shouldReportArgumentsAreDifferent()
96 wanted = buildIntArgMethod().arg(2222).toInvocationMatcher(); in shouldReportWantedDiffersFromActual()
106 checkMissingInvocation(invocations, wanted, context); in shouldReportWantedDiffersFromActual()
DMissingInvocationCheckerTest.java25 private InvocationMatcher wanted; field in MissingInvocationCheckerTest
36 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldPassBecauseActualInvocationFound()
39 MissingInvocationChecker.checkMissingInvocation(invocations, wanted); in shouldPassBecauseActualInvocationFound()
44 wanted = buildSimpleMethod().toInvocationMatcher(); in shouldReportWantedButNotInvoked()
53 MissingInvocationChecker.checkMissingInvocation(invocations, wanted); in shouldReportWantedButNotInvoked()
58 wanted = buildIntArgMethod().arg(2222).toInvocationMatcher(); in shouldReportWantedInvocationDiffersFromActual()
68 MissingInvocationChecker.checkMissingInvocation(invocations, wanted); in shouldReportWantedInvocationDiffersFromActual()
/external/mockito/src/main/java/org/mockito/internal/verification/checkers/
DNumberOfInvocationsChecker.java32 …eckNumberOfInvocations(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount) { in checkNumberOfInvocations() argument
33 List<Invocation> actualInvocations = findInvocations(invocations, wanted); in checkNumberOfInvocations()
38 …throw tooLittleActualInvocations(new Discrepancy(wantedCount, actualCount), wanted, lastInvocation… in checkNumberOfInvocations()
42 throw neverWantedButInvoked(wanted, firstUndesired); in checkNumberOfInvocations()
46 throw tooManyActualInvocations(wantedCount, actualCount, wanted, firstUndesired); in checkNumberOfInvocations()
49 markVerified(actualInvocations, wanted); in checkNumberOfInvocations()
52 …eckNumberOfInvocations(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount, … in checkNumberOfInvocations() argument
53 List<Invocation> chunk = findMatchingChunk(invocations, wanted, wantedCount, context); in checkNumberOfInvocations()
59 …oLittleActualInvocationsInOrder(new Discrepancy(wantedCount, actualCount), wanted, lastInvocation); in checkNumberOfInvocations()
63 throw tooManyActualInvocationsInOrder(wantedCount, actualCount, wanted, firstUndesired); in checkNumberOfInvocations()
[all …]
DMissingInvocationChecker.java29 …blic static void checkMissingInvocation(List<Invocation> invocations, MatchableInvocation wanted) { in checkMissingInvocation() argument
30 List<Invocation> actualInvocations = findInvocations(invocations, wanted); in checkMissingInvocation()
36 Invocation similar = findSimilarInvocation(invocations, wanted); in checkMissingInvocation()
38 throw wantedButNotInvoked(wanted, invocations); in checkMissingInvocation()
41 …Integer[] indexesOfSuspiciousArgs = getSuspiciouslyNotMatchingArgsIndexes(wanted.getMatchers(), si… in checkMissingInvocation()
42 SmartPrinter smartPrinter = new SmartPrinter(wanted, similar, indexesOfSuspiciousArgs); in checkMissingInvocation()
47 …checkMissingInvocation(List<Invocation> invocations, MatchableInvocation wanted, InOrderContext co… in checkMissingInvocation() argument
48 List<Invocation> chunk = findAllMatchingUnverifiedChunks(invocations, wanted, context); in checkMissingInvocation()
56 throw wantedButNotInvokedInOrder(wanted, previousInOrder); in checkMissingInvocation()
59 checkMissingInvocation(invocations, wanted); in checkMissingInvocation()
DAtLeastXNumberOfInvocationsChecker.java24 …astNumberOfInvocations(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount) { in checkAtLeastNumberOfInvocations() argument
25 List<Invocation> actualInvocations = findInvocations(invocations, wanted); in checkAtLeastNumberOfInvocations()
30 …tooLittleActualInvocations(new AtLeastDiscrepancy(wantedCount, actualCount), wanted, lastLocation); in checkAtLeastNumberOfInvocations()
33 markVerified(actualInvocations, wanted); in checkAtLeastNumberOfInvocations()
36 …astNumberOfInvocations(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount,I… in checkAtLeastNumberOfInvocations() argument
37 … List<Invocation> chunk = findAllMatchingUnverifiedChunks(invocations, wanted, orderingContext); in checkAtLeastNumberOfInvocations()
43 …leActualInvocationsInOrder(new AtLeastDiscrepancy(wantedCount, actualCount), wanted, lastLocation); in checkAtLeastNumberOfInvocations()
46 markVerifiedInOrder(chunk, wanted, orderingContext); in checkAtLeastNumberOfInvocations()
/external/mockito/src/main/java/org/mockito/internal/verification/
DVerificationDataImpl.java20 private final InvocationMatcher wanted; field in VerificationDataImpl
23 public VerificationDataImpl(InvocationContainer invocations, InvocationMatcher wanted) { in VerificationDataImpl() argument
25 this.wanted = wanted; in VerificationDataImpl()
36 return wanted; in getTarget()
41 return wanted; in getWanted()
45 if (wanted == null) { in assertWantedIsVerifiable()
48 if (isToStringMethod(wanted.getMethod())) { in assertWantedIsVerifiable()
/external/python/cpython2/Lib/distutils/tests/
Dtest_build.py24 wanted = os.path.join(cmd.build_base, 'lib')
25 self.assertEqual(cmd.build_purelib, wanted)
34 wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
35 self.assertEqual(cmd.build_platlib, wanted)
41 wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
42 self.assertEqual(cmd.build_temp, wanted)
45 wanted = os.path.join(cmd.build_base, 'scripts-' + sys.version[0:3])
46 self.assertEqual(cmd.build_scripts, wanted)
Dtest_version.py35 for v1, v2, wanted in versions:
39 if wanted is ValueError:
45 self.assertEqual(res, wanted,
47 (v1, v2, wanted, res))
61 for v1, v2, wanted in versions:
63 self.assertEqual(res, wanted,
65 (v1, v2, wanted, res))
Dtest_dir_util.py40 wanted = []
41 self.assertEqual(self._logs, wanted)
45 wanted = ['creating %s' % self.root_target,
47 self.assertEqual(self._logs, wanted)
51 wanted = ["removing '%s' (and everything under it)" % self.root_target]
52 self.assertEqual(self._logs, wanted)
73 wanted = ['creating %s' % self.root_target]
75 self.assertEqual(self._logs, wanted)
97 wanted = ['copying %s -> %s' % (a_file, self.target2)]
99 self.assertEqual(self._logs, wanted)
/external/mockito/src/main/java/org/mockito/internal/matchers/apachecommons/
DReflectionEquals.java14 private final Object wanted; field in ReflectionEquals
17 public ReflectionEquals(Object wanted, String... excludeFields) { in ReflectionEquals() argument
18 this.wanted = wanted; in ReflectionEquals()
23 return EqualsBuilder.reflectionEquals(wanted, actual, excludeFields); in matches()
27 return "refEq(" + wanted + ")"; in toString()
/external/mockito/src/main/java/org/mockito/internal/exceptions/
DReporter.java294 …public static AssertionError argumentsAreDifferent(String wanted, String actual, Location actualLo… in argumentsAreDifferent() argument
296 wanted, in argumentsAreDifferent()
304 return ExceptionFactory.createArgumentsAreDifferentException(message, wanted, actual); in argumentsAreDifferent()
307 public static MockitoAssertionError wantedButNotInvoked(DescribedInvocation wanted) { in wantedButNotInvoked() argument
308 return new WantedButNotInvoked(createWantedButNotInvokedMessage(wanted)); in wantedButNotInvoked()
311 …public static MockitoAssertionError wantedButNotInvoked(DescribedInvocation wanted, List<? extends… in wantedButNotInvoked() argument
327 String message = createWantedButNotInvokedMessage(wanted); in wantedButNotInvoked()
331 private static String createWantedButNotInvokedMessage(DescribedInvocation wanted) { in createWantedButNotInvokedMessage() argument
334 wanted.toString(), in createWantedButNotInvokedMessage()
340 …public static MockitoAssertionError wantedButNotInvokedInOrder(DescribedInvocation wanted, Describ… in wantedButNotInvokedInOrder() argument
[all …]
/external/mockito/src/main/java/org/mockito/internal/reporting/
DSmartPrinter.java19 private final String wanted; field in SmartPrinter
22 …public SmartPrinter(MatchableInvocation wanted, Invocation actual, Integer ... indexesOfMatchersTo… in SmartPrinter() argument
24 … printSettings.setMultiline(wanted.toString().contains("\n") || actual.toString().contains("\n")); in SmartPrinter()
27 this.wanted = printSettings.print(wanted); in SmartPrinter()
32 return wanted; in getWanted()
/external/mockito/src/main/java/org/mockito/internal/junit/
DExceptionFactory.java20 …public static AssertionError createArgumentsAreDifferentException(String message, String wanted, S… in createArgumentsAreDifferentException() argument
22 return createJUnitArgumentsAreDifferent(message, wanted, actual); in createArgumentsAreDifferentException()
27 …private static AssertionError createJUnitArgumentsAreDifferent(String message, String wanted, Stri… in createJUnitArgumentsAreDifferent() argument
28 return JUnitArgsAreDifferent.create(message, wanted, actual); in createJUnitArgumentsAreDifferent()
48 static AssertionError create(String message, String wanted, String actual) { in create() argument
49 …eturn new org.mockito.exceptions.verification.junit.ArgumentsAreDifferent(message, wanted, actual); in create()
/external/mockito/src/test/java/org/mockito/internal/verification/
DOnlyTest.java26 private final InvocationMatcher wanted; field in OnlyTest.VerificationDataStub
28 public VerificationDataStub(InvocationMatcher wanted, Invocation invocation) { in VerificationDataStub() argument
30 this.wanted = wanted; in VerificationDataStub()
39 return wanted; in getTarget()
43 return wanted; in getWanted()
/external/mockito/src/main/java/org/mockito/internal/verification/api/
DVerificationDataInOrderImpl.java17 private final MatchableInvocation wanted; field in VerificationDataInOrderImpl
19 …aInOrderImpl(InOrderContext inOrder, List<Invocation> allInvocations, MatchableInvocation wanted) { in VerificationDataInOrderImpl() argument
22 this.wanted = wanted; in VerificationDataInOrderImpl()
34 return wanted; in getWanted()

12345678910