Add unit tests for terms aggregation objects.#23149
Merged
jpountz merged 2 commits intoelastic:masterfrom Feb 17, 2017
Merged
Conversation
63 tasks
nik9000
approved these changes
Feb 15, 2017
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| return super.equals(obj) && Objects.equals(term, ((Bucket) obj).term); |
Member
There was a problem hiding this comment.
This probably needs the traditional class comparison to make sure the cast doesn't blow up.
Contributor
Author
There was a problem hiding this comment.
The super.equals call already guarantees it.
|
|
||
| @Override | ||
| protected boolean doEquals(Object obj) { | ||
| InternalMappedTerms<?,?> that = (InternalMappedTerms<?,?>) obj; |
Contributor
Author
There was a problem hiding this comment.
It is called from equals, which already does this check.
Member
There was a problem hiding this comment.
Yeah, I see now. Sorry, I wasn't being careful.
|
|
||
| @Override | ||
| protected boolean doEquals(Object obj) { | ||
| InternalTerms<?,?> that = (InternalTerms<?,?>) obj; |
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| return super.equals(obj) && Objects.equals(term, ((Bucket) obj).term); |
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| return super.equals(obj) && Objects.equals(termBytes, ((Bucket) obj).termBytes); |
| final int numBuckets = randomInt(shardSize); | ||
| Set<Double> terms = new HashSet<>(); | ||
| for (int i = 0; i < numBuckets; ++i) { | ||
| double term; |
Member
There was a problem hiding this comment.
randomValueOtherThanMany might make this easier to read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates #22278