Skip to content

Commit

Permalink
[SPARK-12376][TESTS] Spark Streaming Java8APISuite fails in assertOrd…
Browse files Browse the repository at this point in the history
…erInvariantEquals method

org.apache.spark.streaming.Java8APISuite.java is failing due to trying to sort immutable list in assertOrderInvariantEquals method.

Author: Evan Chen <[email protected]>

Closes #10336 from evanyc15/SPARK-12376-StreamingJavaAPISuite.
  • Loading branch information
Evan Chen authored and zsxwing committed Dec 17, 2015
1 parent e096a65 commit ed6ebda
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,14 @@ 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);
expected.forEach(list -> Collections.sort(list));
List<List<T>> sortedActual = new ArrayList<>();
actual.forEach(list -> {
List<T> sortedList = new ArrayList<>(list);
Collections.sort(sortedList);
sortedActual.add(sortedList);
});
Assert.assertEquals(expected, sortedActual);
}

@Test
Expand Down

0 comments on commit ed6ebda

Please sign in to comment.