-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-12376][TESTS] Spark Streaming Java8APISuite fails in assertOrderInvariantEquals method #10336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-12376][TESTS] Spark Streaming Java8APISuite fails in assertOrderInvariantEquals method #10336
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| import com.google.common.base.Optional; | ||
| import com.google.common.collect.Lists; | ||
| import com.google.common.collect.Sets; | ||
| import com.google.common.collect.Ordering; | ||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
|
|
||
|
|
@@ -440,8 +441,13 @@ public void testPairFlatMap() { | |
| public static <T extends Comparable<T>> void assertOrderInvariantEquals( | ||
| List<List<T>> expected, List<List<T>> actual) { | ||
| expected.forEach((List<T> list) -> Collections.sort(list)); | ||
| actual.forEach((List<T> list) -> Collections.sort(list)); | ||
| Assert.assertEquals(expected, actual); | ||
| ArrayList<ArrayList<T>> sortedActual = new ArrayList<ArrayList<T>>(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be |
||
| actual.forEach((List<T> list) -> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be cleverer, like
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey srowen, I feel like this can be more confusing to follow. Does your code alternative have any increases in performance? Thank you
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really? it's a little less code and matches the functional style of other (Scala) code. Performance is not an issue here. However I forgot the collect(). How about: EDIT: nah that doesn't quite work since sort doesn't return the list. No big deal, whatever of this seems clearest.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The arg does not need a type. |
||
| ArrayList<T> sortedList = new ArrayList<T>(list); | ||
| Collections.sort(sortedList); | ||
| sortedActual.add(sortedList); | ||
| }); | ||
| Assert.assertEquals(expected, sortedActual); | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is used.