/external/hamcrest/hamcrest-core/src/main/java/org/hamcrest/core/ |
AllOf.java | 5 import org.hamcrest.Matcher; 12 * subsequent matchers are not called if an earlier matcher returns <code>false</code>. 16 private final Iterable<Matcher<? super T>> matchers; 18 public AllOf(Iterable<Matcher<? super T>> matchers) { 24 for (Matcher<? super T> matcher : matchers) { 25 if (!matcher.matches(o)) { 26 mismatch.appendDescriptionOf(matcher).appendText(" "); 27 matcher.describeMismatch(o, mismatch); 40 * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers [all...] |
Is.java | 5 import org.hamcrest.Matcher; 11 * Decorates another Matcher, retaining the behaviour but allowing tests 18 private final Matcher<T> matcher; field in class:Is 20 public Is(Matcher<T> matcher) { 21 this.matcher = matcher; 26 return matcher.matches(arg); 31 description.appendText("is ").appendDescriptionOf(matcher); [all...] |
Every.java | 4 import org.hamcrest.Matcher; 8 private final Matcher<? super T> matcher; field in class:Every 10 public Every(Matcher<? super T> matcher) { 11 this.matcher= matcher; 17 if (!matcher.matches(t)) { 19 matcher.describeMismatch(t, mismatchDescription); 28 description.appendText("every item is ").appendDescriptionOf(matcher); [all...] |
ShortcutCombination.java | 5 import org.hamcrest.Matcher; 9 private final Iterable<Matcher<? super T>> matchers; 11 public ShortcutCombination(Iterable<Matcher<? super T>> matchers) { 22 for (Matcher<? super T> matcher : matchers) { 23 if (matcher.matches(o) == shortcut) {
|
/external/junit/src/main/java/org/junit/matchers/ |
JUnitMatchers.java | 4 import org.hamcrest.Matcher; 17 * @return A matcher matching any collection containing element 21 public static <T> Matcher<Iterable<? super T>> hasItem(T element) { 26 * @return A matcher matching any collection containing an element matching elementMatcher 27 * @deprecated Please use {@link CoreMatchers#hasItem(Matcher)} instead. 30 public static <T> Matcher<Iterable<? super T>> hasItem(Matcher<? super T> elementMatcher) { 35 * @return A matcher matching any collection containing every element in elements 39 public static <T> Matcher<Iterable<T>> hasItems(T... elements) { 44 * @return A matcher matching any collection containing at least one element that matche [all...] |
/packages/apps/Launcher3/tests/src/com/android/launcher3/allapps/search/ |
DefaultAppSearchAlgorithmTest.java | 35 private static final DefaultAppSearchAlgorithm.StringMatcher MATCHER = 40 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("white cow"), "cow", MATCHER)); 41 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("whiteCow"), "cow", MATCHER)); 42 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("whiteCOW"), "cow", MATCHER)); 43 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("whitecowCOW"), "cow", MATCHER)); 44 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("white2cow"), "cow", MATCHER)); 46 assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("whitecow"), "cow", MATCHER)); 47 assertFalse(DefaultAppSearchAlgorithm.matches(getInfo("whitEcow"), "cow", MATCHER)); 49 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("whitecowCow"), "cow", MATCHER)); 50 assertTrue(DefaultAppSearchAlgorithm.matches(getInfo("whitecow cow"), "cow", MATCHER)); [all...] |
/frameworks/base/media/mca/filterfw/java/android/filterfw/io/ |
PatternScanner.java | 20 import java.util.regex.Matcher; 50 // Create the matcher 51 Matcher matcher = pattern.matcher(mInput); local 52 matcher.region(mOffset, mInput.length()); 56 if (matcher.lookingAt()) { 57 updateLineCount(mOffset, matcher.end()); 58 mOffset = matcher.end(); 59 result = mInput.substring(matcher.start(), matcher.end()) 85 Matcher matcher = pattern.matcher(mInput); local 93 Matcher matcher = pattern.matcher(mInput); local [all...] |
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/core/ |
IsInstanceOfTest.java | 3 import org.hamcrest.Matcher; 14 Matcher<?> matcher = instanceOf(Number.class); local 16 assertNullSafe(matcher); 17 assertUnknownTypeSafe(matcher); 22 final Matcher<Object> matcher = instanceOf(Number.class); local 24 assertMatches(matcher, 1); 25 assertMatches(matcher, 1.1); 26 assertDoesNotMatch(matcher, null) [all...] |
IsAnythingTest.java | 3 import org.hamcrest.Matcher; 12 private final Matcher<Object> matcher = anything(); field in class:IsAnythingTest 18 assertMatches("didn't match null", matcher, null); 19 assertMatches("didn't match Object", matcher, new Object()); 20 assertMatches("didn't match custom object", matcher, new CustomThing()); 21 assertMatches("didn't match String", matcher, "hi"); 26 assertDescription("ANYTHING", matcher);
|
/external/hamcrest/hamcrest-library/src/main/java/org/hamcrest/collection/ |
IsArrayWithSize.java | 4 import org.hamcrest.Matcher; 10 * Matches if array size satisfies a nested matcher. 13 public IsArrayWithSize(Matcher<? super Integer> sizeMatcher) { 23 * Creates a matcher for arrays that matches when the <code>length</code> of the array 24 * satisfies the specified matcher. 29 * a matcher for the length of an examined array 31 public static <E> Matcher<E[]> arrayWithSize(Matcher<? super Integer> sizeMatcher) { 36 * Creates a matcher for arrays that matches when the <code>length</code> of the array 44 public static <E> Matcher<E[]> arrayWithSize(int size) [all...] |
IsMapWithSize.java | 4 import org.hamcrest.Matcher; 11 * Matches if map size satisfies a nested matcher. 14 public IsMapWithSize(Matcher<? super Integer> sizeMatcher) { 24 * Creates a matcher for {@link java.util.Map}s that matches when the <code>size()</code> method returns 25 * a value that satisfies the specified matcher. 30 * a matcher for the size of an examined {@link java.util.Map} 32 public static <K, V> Matcher<Map<? extends K, ? extends V>> aMapWithSize(Matcher<? super Integer> sizeMatcher) { 37 * Creates a matcher for {@link java.util.Map}s that matches when the <code>size()</code> method returns 45 public static <K, V> Matcher<Map<? extends K, ? extends V>> aMapWithSize(int size) 46 Matcher<? super Integer> matcher = equalTo(size); local [all...] |
IsCollectionWithSize.java | 4 import org.hamcrest.Matcher; 11 * Matches if collection size satisfies a nested matcher. 14 public IsCollectionWithSize(Matcher<? super Integer> sizeMatcher) { 24 * Creates a matcher for {@link java.util.Collection}s that matches when the <code>size()</code> method returns 25 * a value that satisfies the specified matcher. 30 * a matcher for the size of an examined {@link java.util.Collection} 32 public static <E> Matcher<Collection<? extends E>> hasSize(Matcher<? super Integer> sizeMatcher) { 37 * Creates a matcher for {@link java.util.Collection}s that matches when the <code>size()</code> method returns 46 public static <E> Matcher<Collection<? extends E>> hasSize(int size) [all...] |
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/text/ |
IsEqualIgnoringWhiteSpaceTest.java | 4 import org.hamcrest.Matcher; 12 private final Matcher<String> matcher = equalToIgnoringWhiteSpace("Hello World how\n are we? "); field in class:IsEqualIgnoringWhiteSpaceTest 15 protected Matcher<?> createMatcher() { 16 return matcher; 20 assertThat("Hello World how are we?", matcher); 21 assertThat(" Hello World how are \n\n\twe?", matcher); 25 assertThat("Hello PLANET how are we?", not(matcher)); 26 assertThat("Hello World how are we", not(matcher)); 30 assertThat("HelloWorld how are we?", not(matcher)); [all...] |
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/ |
TypeSafeMatcherTest.java | 9 private final Matcher<String> matcher = new TypeSafeMatcherSubclass(); field in class:TypeSafeMatcherTest 29 assertFalse(matcher.matches(null)); 30 assertFalse(matcher.matches(10)); 36 assertMismatchDescription("was null", matcher, null); 37 assertMismatchDescription("was a java.lang.Integer (<3>)", (Matcher)matcher, 3); 38 assertMismatchDescription("The mismatch", matcher, "a string");
|
CustomMatcherTest.java | 11 Matcher<String> matcher = new CustomMatcher<String>("I match strings") { local 18 assertDescription("I match strings", matcher);
|
/external/mockito/src/test/java/org/mockitousage/bugs/ |
EqualsWithDeltaTest.java | 13 ArgumentMatcher<Number> matcher = equalsWithDelta(null); local 14 assertThat(matcher.matches(1.0)).isFalse(); 19 ArgumentMatcher<Number> matcher = equalsWithDelta(1.0); local 20 assertThat(matcher.matches(null)).isFalse(); 25 ArgumentMatcher<Number> matcher = equalsWithDelta(null); local 26 assertThat(matcher.matches(null)).isTrue(); 33 ArgumentMatcher<Number> matcher = equalsWithDelta(expected); local 34 assertThat(matcher.matches(actual)).isTrue();
|
/development/tools/bugreport/src/com/android/bugreport/util/ |
Utils.java | 22 import java.util.regex.Matcher; 46 * Returns whether text matches the matcher. The matcher can be used afterwards 49 public static boolean matches(Matcher matcher, String text) { 50 matcher.reset(text); 51 return matcher.matches(); 55 * Returns the matcher if it matches the text, null otherwise. 57 public static Matcher match(Matcher matcher, String text) [all...] |
/external/junit/src/main/java/org/junit/internal/matchers/ |
ThrowableCauseMatcher.java | 5 import org.hamcrest.Matcher; 9 * A matcher that applies a delegate matcher to the cause of the current Throwable, returning the result of that 17 private final Matcher<? extends Throwable> causeMatcher; 19 public ThrowableCauseMatcher(Matcher<? extends Throwable> causeMatcher) { 40 * Returns a matcher that verifies that the outer exception has a cause for which the supplied matcher 43 * @param matcher to apply to the cause of the outer exception 47 public static <T extends Throwable> Matcher<T> hasCause(final Matcher<? extends Throwable> matcher) [all...] |
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/number/ |
IsNanTest.java | 3 import org.hamcrest.Matcher; 13 Matcher<Double> matcher = notANumber(); local 15 assertNullSafe(matcher); 16 assertUnknownTypeSafe(matcher);
|
/external/mockito/src/main/java/org/mockito/internal/hamcrest/ |
MatcherGenericTypeExtractor.java | 8 import org.hamcrest.Matcher; 13 * Extracts generic type of matcher 18 * Gets the generic type of given matcher. For example, 19 * for matcher class that extends BaseMatcher[Integer] this method returns Integer 23 return genericTypeOf(matcherClass, BaseMatcher.class, Matcher.class);
|
/external/mockito/src/main/java/org/mockito/internal/matchers/ |
LocalizedMatcher.java | 14 private final ArgumentMatcher<?> matcher; field in class:LocalizedMatcher 17 public LocalizedMatcher(ArgumentMatcher<?> matcher) { 18 this.matcher = matcher; 27 return matcher;
|
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/object/ |
MatchesPatternTest.java | 3 import org.hamcrest.Matcher; 15 Matcher<String> matcher = new MatchesPattern(Pattern.compile(".")); local 17 assertNullSafe(matcher); 18 assertUnknownTypeSafe(matcher); 38 Matcher<?> m = new MatchesPattern(Pattern.compile("a[bc](d|e)")); 44 final Matcher<String> matcher = new MatchesPattern(Pattern.compile("a")); local 45 assertMismatchDescription("was \"Cheese\"", matcher, "Cheese"); 50 Matcher<?> m = MatchesPattern.matchesPattern(Pattern.compile("a[bc](d|e)")) [all...] |
/frameworks/support/wear/tests/src/android/support/wear/widget/util/ |
MoreViewAssertions.java | 19 import static android.support.test.espresso.matcher.ViewMatchers.assertThat; 28 import org.hamcrest.Matcher; 33 public static ViewAssertion left(final Matcher<Integer> matcher) { 37 assertThat("View left: " + HumanReadables.describe(view), view.getLeft(), matcher); 42 public static ViewAssertion approximateTop(final Matcher<Double> matcher) { 47 matcher); 52 public static ViewAssertion top(final Matcher<Integer> matcher) { [all...] |
/external/robolectric/v1/src/test/java/com/xtremelabs/robolectric/shadows/ |
UriMatcherTest.java | 22 UriMatcher matcher; field in class:UriMatcherTest 28 matcher = new UriMatcher(NO_MATCH); 29 root = Robolectric.shadowOf(matcher).rootNode; 43 matcher.addURI(AUTH, path, 1); 57 matcher.addURI(AUTH, "#", 1); 58 matcher.addURI(AUTH, "*", 2); 66 matcher.addURI(AUTH, "bar", 1); 67 assertThat(matcher.match(Uri.withAppendedPath(URI, "bar")), is(1)); 69 matcher.addURI(AUTH, "bar/#", 2); 70 assertThat(matcher.match(Uri.withAppendedPath(URI, "bar/1")), is(2)) [all...] |
/external/mockito/src/main/java/org/mockito/hamcrest/ |
MockitoHamcrest.java | 7 import org.hamcrest.Matcher; 21 * Before implementing or reusing an existing hamcrest matcher please read 55 * @param matcher decides whether argument matches 60 public static <T> T argThat(Matcher<T> matcher) { 61 reportMatcher(matcher); 62 return (T) defaultValue(genericTypeOfMatcher(matcher.getClass())); 71 * @param matcher decides whether argument matches 74 public static char charThat(Matcher<Character> matcher) { [all...] |