Home
last modified time | relevance | path

Searched refs:equalTo (Results 1 – 25 of 74) sorted by relevance

123

/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/collection/
DIsArrayTest.java9 import static org.hamcrest.core.IsEqual.equalTo;
16 return array(equalTo("irrelevant")); in createMatcher()
21 array(equalTo("a"), equalTo("b"), equalTo("c")), new String[]{"a", "b", "c"}); in testMatchesAnArrayThatMatchesAllTheElementMatchers()
26 array(equalTo("a"), equalTo("b")), new String[]{"b", "c"}); in testDoesNotMatchAnArrayWhenElementsDoNotMatch()
31 array(equalTo("a"), equalTo("b")), new String[]{"a", "b", "c"}); in testDoesNotMatchAnArrayOfDifferentSize()
33 array(equalTo("a"), equalTo("b")), new String[]{"a"}); in testDoesNotMatchAnArrayOfDifferentSize()
38 array(equalTo("a")), null); in testDoesNotMatchNull()
42 assertDescription("[\"a\", \"b\"]", array(equalTo("a"), equalTo("b"))); in testHasAReadableDescription()
46 …assertMismatchDescription("element <0> was \"c\"", array(equalTo("a"), equalTo("b")), new String[]… in testHasAReadableMismatchDescriptionUsing()
57 …assertMismatchDescription("element <0> didn't match", array(m, equalTo("b")), new String[]{"c", "b… in testHasAReadableMismatchDescriptionUsingCustomMatchers()
DIsCollectionWithSizeTest.java13 import static org.hamcrest.core.IsEqual.equalTo;
23 assertMatches("correct size", hasSize(equalTo(2)), asList(null, null)); in testMatchesWhenSizeIsCorrect()
24 …assertMismatchDescription("collection size was <3>", hasSize(equalTo(2)), asList(null, null, null)… in testMatchesWhenSizeIsCorrect()
29 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingObjectElementType()
30 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingObjectElementType()
35 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingStringElementType()
36 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingStringElementType()
41 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesCollectionWhenSizeIsCorrectUsingWildcardElementType()
42 assertMismatchDescription("collection size was <2>", hasSize(equalTo(3)), list); in testMatchesCollectionWhenSizeIsCorrectUsingWildcardElementType()
47 assertMatches("correct size", hasSize(equalTo(2)), list); in testMatchesListWhenSizeIsCorrectUsingObjectElementType()
[all …]
DIsMapWithSizeTest.java11 import static org.hamcrest.core.IsEqual.equalTo;
21 assertMatches("correct size", aMapWithSize(equalTo(2)), mapWithKeys("a", "b")); in testMatchesWhenSizeIsCorrect()
22 …assertMismatchDescription("map size was <3>", aMapWithSize(equalTo(2)), mapWithKeys("a", "b", "c")… in testMatchesWhenSizeIsCorrect()
27 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingObjectElementType()
28 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingObjectElementType()
33 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingStringElementType()
34 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingStringElementType()
39 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesMapWhenSizeIsCorrectUsingWildcardElementType()
40 assertMismatchDescription("map size was <2>", aMapWithSize(equalTo(3)), map); in testMatchesMapWhenSizeIsCorrectUsingWildcardElementType()
45 assertMatches("correct size", aMapWithSize(equalTo(2)), map); in testMatchesListWhenSizeIsCorrectUsingObjectElementType()
[all …]
DIsArrayContainingInAnyOrderTest.java7 import static org.hamcrest.core.IsEqual.equalTo;
14 return arrayContainingInAnyOrder(equalTo(1), equalTo(2)); in createMatcher()
19 … assertDescription("[<1>, <2>] in any order", arrayContainingInAnyOrder(equalTo(1), equalTo(2))); in testHasAReadableDescription()
31 …assertMatches("in order", arrayContainingInAnyOrder(equalTo(1), equalTo(2), equalTo(3)), new Integ… in testAppliesMatchersInAnyOrder()
32 …assertMatches("out of order", arrayContainingInAnyOrder(equalTo(1), equalTo(2), equalTo(3)), new I… in testAppliesMatchersInAnyOrder()
33 assertMatches("single", arrayContainingInAnyOrder(equalTo(1)), new Integer[] {1}); in testAppliesMatchersInAnyOrder()
DIsMapContainingTest.java11 import static org.hamcrest.core.IsEqual.equalTo;
25 assertMatches("matcherA", hasEntry(equalTo("a"), equalTo(1)), map); in testMatchesMapContainingMatchingKeyAndValue()
26 assertMatches("matcherB", hasEntry(equalTo("b"), equalTo(2)), map); in testMatchesMapContainingMatchingKeyAndValue()
27 … assertMismatchDescription("map was [<a=1>, <b=2>]", hasEntry(equalTo("c"), equalTo(3)), map); in testMatchesMapContainingMatchingKeyAndValue()
46 assertDescription("map containing [\"a\"-><2>]", hasEntry(equalTo("a"), (equalTo(2)))); in testHasReadableDescription()
DIsArrayContainingInOrderTest.java7 import static org.hamcrest.core.IsEqual.equalTo;
14 return arrayContaining(equalTo(1), equalTo(2)); in createMatcher()
19 assertDescription("[<1>, <2>]", arrayContaining(equalTo(1), equalTo(2))); in testHasAReadableDescription()
29 …assertMatches("in order", arrayContaining(equalTo(1), equalTo(2), equalTo(3)), new Integer[] {1, 2… in testAppliesMatchersInOrder()
30 assertMatches("single", arrayContaining(equalTo(1)), new Integer[] {1}); in testAppliesMatchersInOrder()
DIsArrayWithSizeTest.java8 import static org.hamcrest.core.IsEqual.equalTo;
14 return arrayWithSize(equalTo(2)); in createMatcher()
18 assertMatches("correct size", arrayWithSize(equalTo(3)), new Object[] {1, 2, 3}); in testMatchesWhenSizeIsCorrect()
19 assertDoesNotMatch("incorrect size", arrayWithSize(equalTo(2)), new Object[] {1, 2, 3}); in testMatchesWhenSizeIsCorrect()
33 assertDescription("an array with size <3>", arrayWithSize(equalTo(3))); in testHasAReadableDescription()
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/core/
DIsCollectionContainingTest.java16 import static org.hamcrest.core.IsEqual.equalTo;
22 Matcher<?> matcher = hasItem(equalTo("irrelevant")); in copesWithNullsAndUnknownTypes()
30 final Matcher<Iterable<? super String>> itemMatcher = hasItem(equalTo("a")); in matchesACollectionThatContainsAnElementForTheGivenMatcher()
45 assertDoesNotMatch("doesn't match null", hasItem(equalTo("a")), null); in doesNotMatchNull()
65 … final Matcher<Iterable<String>> matcher1 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection()
71 … final Matcher<Iterable<String>> matcher3 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection()
74 … final Matcher<Iterable<String>> matcher4 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection()
77 … final Matcher<Iterable<String>> matcher5 = hasItems(equalTo("a"), equalTo("b"), equalTo("c")); in matchesMultipleItemsInCollection()
DIsEqualTest.java7 import static org.hamcrest.core.IsEqual.equalTo;
14 Matcher<?> matcher = equalTo("irrelevant"); in copesWithNullsAndUnknownTypes()
22 final Matcher<String> matcher1 = equalTo("hi"); in comparesObjectsUsingEqualsMethod()
27 final Matcher<Integer> matcher2 = equalTo(1); in comparesObjectsUsingEqualsMethod()
35 final Matcher<Object> matcher = equalTo(null); in canCompareNullValues()
59 Matcher<Object> matcher = equalTo(null); in honoursIsEqualImplementationEvenWithNullValues()
72 final Matcher<String[]> matcher = equalTo(s1); in comparesTheElementsOfAnObjectArray()
87 final Matcher<int[]> matcher = equalTo(i1); in comparesTheElementsOfAnArrayOfPrimitiveTypes()
102 final Matcher<int[][]> matcher = equalTo(i1); in recursivelyTestsElementsOfArrays()
129 assertDescription("<" + argumentDescription + ">", equalTo(argument)); in includesTheResultOfCallingToStringOnItsArgumentInTheDescription()
[all …]
DAllOfTest.java9 import static org.hamcrest.core.IsEqual.equalTo;
18 Matcher<String> matcher = allOf(equalTo("irrelevant"), startsWith("irr")); in copesWithNullsAndUnknownTypes()
45 equalTo(new SampleBaseClass("bad")), in supportsMixedTypes()
47 equalTo(new SampleBaseClass("good")), in supportsMixedTypes()
48 equalTo(new SampleSubClass("ugly"))); in supportsMixedTypes()
56 allOf(equalTo("good"), equalTo("bad"), equalTo("ugly"))); in hasAReadableDescription()
61 … assertMismatchDescription("\"good\" was \"bad\"", allOf(equalTo("bad"), equalTo("good")), "bad"); in hasAMismatchDescriptionDescribingTheFirstFailingMatch()
DAnyOfTest.java8 import static org.hamcrest.core.IsEqual.equalTo;
16 Matcher<String> matcher = anyOf(equalTo("irrelevant"), startsWith("irr")); in copesWithNullsAndUnknownTypes()
44 equalTo(new SampleBaseClass("bad")), in supportsMixedTypes()
45 equalTo(new SampleBaseClass("good")), in supportsMixedTypes()
46 equalTo(new SampleSubClass("ugly"))); in supportsMixedTypes()
54 anyOf(equalTo("good"), equalTo("bad"), equalTo("ugly"))); in hasAReadableDescription()
DCombinableTest.java7 import static org.hamcrest.core.IsEqual.equalTo;
12 …nableMatcher<Integer> EITHER_3_OR_4 = CombinableMatcher.<Integer>either(equalTo(3)).or(equalTo(4));
13 …r<Integer> NOT_3_AND_NOT_4 = CombinableMatcher.<Integer>both(not(equalTo(3))).and(not(equalTo(4)));
31 CombinableMatcher<? super Integer> tripleAnd = NOT_3_AND_NOT_4.and(equalTo(2)); in acceptsAndRejectsThreeAnds()
51 final CombinableMatcher<Integer> tripleOr = EITHER_3_OR_4.or(equalTo(11)); in acceptsAndRejectsThreeOrs()
66 …Matcher<String> matcher = CombinableMatcher.both(equalTo("yellow")).and(notNullValue(String.class)… in picksUpTypeFromLeftHandSideOfExpression()
DDescribedAsTest.java9 import static org.hamcrest.core.IsEqual.equalTo;
37 Matcher<String> matcher = describedAs("irrelevant", equalTo("hi")); in celegatesMatchingToAnotherMatcher()
45 Matcher<Integer> matcher = describedAs("irrelevant", equalTo(2)); in delegatesMismatchDescriptionToAnotherMatcher()
DIsTest.java9 import static org.hamcrest.core.IsEqual.equalTo;
23 final Matcher<Boolean> matcher = is(equalTo(true)); in matchesTheSameWayTheUnderlyingMatcherDoes()
31 assertDescription("is <true>", is(equalTo(true))); in generatesIsPrefixInDescription()
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/xml/
DHasXPathTest.java16 import static org.hamcrest.core.IsEqual.equalTo;
70 assertMatches(hasXPath("/root/something[2]/cheese", equalTo("Cheddar")), xml); in appliesMatcherToXPathInDocument()
73 assertMatches(hasXPath("/root/@type", equalTo("food")), xml); in appliesMatcherToXPathInDocument()
74 assertMatches(hasXPath("//something[@id='b']/cheese", equalTo("Cheddar")), xml); in appliesMatcherToXPathInDocument()
90 assertDoesNotMatch(hasXPath("/root/something[3]/cheese", ns, equalTo("Cheddar")), xml); in failsIfNodeIsMissing()
96 assertDoesNotMatch(hasXPath("//cheese:foreignSomething", equalTo("Badger")), xml); in failsIfNodeIsMissingInNamespace()
103 assertMatches(hasXPath("//cheese:foreignSomething/@milk", ns, equalTo("camel")), xml); in matchesWithNamespace()
104 assertMatches(hasXPath("//cheese:foreignSomething/text()", ns, equalTo("Caravane")), xml); in matchesWithNamespace()
110 hasXPath("\\g:dfgd::DSgf/root/something[2]/cheese", equalTo("blah")); in throwsIllegalArgumentExceptionIfGivenIllegalExpression()
120 hasXPath("/some/path", equalTo("Cheddar"))); in describesItself()
[all …]
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/io/
DFileMatchersTest.java8 import static org.hamcrest.core.IsEqual.equalTo;
65 assertMatches("matches file size", FileMatchers.aFileWithSize(equalTo(0L)), file); in testAFileWithSizeMatcherOfLong()
67 …assertDoesNotMatch("doesn't match incorrect file size", FileMatchers.aFileWithSize(equalTo(23L)), … in testAFileWithSizeMatcherOfLong()
71 assertMatches("matches file name", FileMatchers.aFileNamed(equalTo(file.getName())), file); in testAFileNamed()
73 …assertDoesNotMatch("doesn't match incorrect file name", FileMatchers.aFileNamed(equalTo("foo")), f… in testAFileNamed()
77 …assertMatches("matches file canonical path", FileMatchers.aFileWithCanonicalPath(equalTo(file.getC… in testAFileWithCanonicalPath()
79 …oesn't match incorrect canonical path", FileMatchers.aFileWithCanonicalPath(equalTo("foo")), file); in testAFileWithCanonicalPath()
83 …assertMatches("matches file absolute path", FileMatchers.aFileWithAbsolutePath(equalTo(file.getAbs… in testAFileWithAbsolutePath()
85 …"doesn't match incorrect absolute path", FileMatchers.aFileWithAbsolutePath(equalTo("foo")), file); in testAFileWithAbsolutePath()
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/beans/
DHasPropertyWithValueTest.java16 import static org.hamcrest.core.IsEqual.equalTo;
37 assertMatches("with property", hasProperty("property", equalTo("is expected")), shouldMatch); in testMatchesInfolessBeanWithMatchedNamedProperty()
39 hasProperty("property", equalTo("is expected")), shouldNotMatch); in testMatchesInfolessBeanWithMatchedNamedProperty()
43 assertMatches("with bean info", hasProperty("property", equalTo("with info")), beanWithInfo); in testMatchesBeanWithInfoWithMatchedNamedProperty()
45 hasProperty("property", equalTo("without info")), beanWithInfo); in testMatchesBeanWithInfoWithMatchedNamedProperty()
59 assertDescription("hasProperty(\"property\", <true>)", hasProperty("property", equalTo(true))); in testDescribeTo()
84 assertThat(new X(), HasPropertyWithValue.hasProperty("test", IsEqual.equalTo(1))); in testCanAccessAnAnonymousInnerClass()
/external/hamcrest/hamcrest-library/src/test/java/org/hamcrest/object/
DHasToStringTest.java7 import static org.hamcrest.core.IsEqual.equalTo;
21 Matcher<Object> matcher = hasToString(equalTo("irrelevant")); in copesWithNullsAndUnknownTypes()
29 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in matchesWhenUtilisingANestedMatcher()
45 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in describesItself()
51 final Matcher<Object> matcher = hasToString(equalTo(TO_STRING_RESULT)); in describesAMismatch()
/external/hamcrest/hamcrest-library/src/main/java/org/hamcrest/collection/
DIsMapContaining.java11 import static org.hamcrest.core.IsEqual.equalTo;
75 return new IsMapContaining<K,V>(equalTo(key), equalTo(value)); in hasEntry()
101 return new IsMapContaining<K,Object>(equalTo(key), anything()); in hasKey()
127 return new IsMapContaining<Object,V>(anything(), equalTo(value)); in hasValue()
DIsMapWithSize.java8 import static org.hamcrest.core.IsEqual.equalTo;
46 Matcher<? super Integer> matcher = equalTo(size); in aMapWithSize()
58 return IsMapWithSize.aMapWithSize(equalTo(0)); in anEmptyMap()
/external/opencensus-java/api/src/test/java/io/opencensus/metrics/export/
DTimeSeriesTest.java65 thrown.expectMessage(CoreMatchers.equalTo("labelValues")); in create_WithNullLabelValueList()
73 thrown.expectMessage(CoreMatchers.equalTo("labelValue")); in create_WithNullLabelValue()
80 thrown.expectMessage(CoreMatchers.equalTo("points")); in create_WithNullPointList()
88 thrown.expectMessage(CoreMatchers.equalTo("point")); in create_WithNullPoint()
107 thrown.expectMessage(CoreMatchers.equalTo("labelValues")); in createWithOnePoint_WithNullLabelValueList()
115 thrown.expectMessage(CoreMatchers.equalTo("labelValue")); in createWithOnePoint_WithNullLabelValue()
122 thrown.expectMessage(CoreMatchers.equalTo("point")); in createWithOnePoint_WithNullPointList()
/external/hamcrest/hamcrest-core/src/test/java/org/hamcrest/
DMatcherAssertTest.java6 import static org.hamcrest.core.IsEqual.equalTo;
19 assertThat("identifier", actual, equalTo(expected)); in includesDescriptionOfTestedValueInErrorMessage()
37 assertThat(actual, equalTo(expected)); in descriptionCanBeElided()
94 assertThat(1, equalTo((Number) 1)); in canAssertSubtypes()
/external/javaparser/javaparser-testing/src/test/java/com/github/javaparser/bdd/steps/
DSharedSteps.java41 import static org.hamcrest.core.IsEqual.equalTo;
100 assertThat(compilationUnit, is(equalTo(compilationUnit2))); in thenTheCompilationUnitIsEqualToTheSecondCompilationUnit()
108 assertThat(compilationUnit.hashCode(), is(equalTo(compilationUnit2.hashCode()))); in thenTheCompilationUnitHasTheSameHashcodeToTheSecondCompilationUnit()
116 assertThat(compilationUnit, not(equalTo(compilationUnit2))); in thenTheCompilationUnitIsNotEqualToTheSecondCompilationUnit()
124 assertThat(compilationUnit.hashCode(), not(equalTo(compilationUnit2.hashCode()))); in thenTheCompilationUnitHasADifferentHashcodeToTheSecondCompilationUnit()
/external/guava/guava-tests/test/com/google/common/base/
DPredicatesTest.java507 Predicate<Integer> isOne = Predicates.equalTo(1); in testIsEqualTo_apply()
516 .addEqualityGroup(Predicates.equalTo(1), Predicates.equalTo(1)) in testIsEqualTo_equality()
517 .addEqualityGroup(Predicates.equalTo(2)) in testIsEqualTo_equality()
518 .addEqualityGroup(Predicates.equalTo(null)) in testIsEqualTo_equality()
524 checkSerialization(Predicates.equalTo(1)); in testIsEqualTo_serialization()
528 Predicate<Integer> isNull = Predicates.equalTo(null); in testIsEqualToNull_apply()
535 .addEqualityGroup(Predicates.equalTo(null), Predicates.equalTo(null)) in testIsEqualToNull_equality()
536 .addEqualityGroup(Predicates.equalTo(1)) in testIsEqualToNull_equality()
537 .addEqualityGroup(Predicates.equalTo("null")) in testIsEqualToNull_equality()
543 checkSerialization(Predicates.equalTo(null)); in testIsEqualToNull_serialization()
[all …]
/external/guava/guava-gwt/test-super/com/google/common/base/super/com/google/common/base/
DPredicatesTest.java427 Predicate<Integer> isOne = Predicates.equalTo(1); in testIsEqualTo_apply()
436 .addEqualityGroup(Predicates.equalTo(1), Predicates.equalTo(1)) in testIsEqualTo_equality()
437 .addEqualityGroup(Predicates.equalTo(2)) in testIsEqualTo_equality()
438 .addEqualityGroup(Predicates.equalTo(null)) in testIsEqualTo_equality()
443 Predicate<Integer> isNull = Predicates.equalTo(null); in testIsEqualToNull_apply()
450 .addEqualityGroup(Predicates.equalTo(null), Predicates.equalTo(null)) in testIsEqualToNull_equality()
451 .addEqualityGroup(Predicates.equalTo(1)) in testIsEqualToNull_equality()
452 .addEqualityGroup(Predicates.equalTo("null")) in testIsEqualToNull_equality()
562 Predicate<String> equalsFoo = Predicates.equalTo("Foo"); in testCompose()
563 Predicate<String> equalsBar = Predicates.equalTo("Bar"); in testCompose()

123