Skip to content
Snippets Groups Projects
Commit ed6ebda5 authored by Evan Chen's avatar Evan Chen Committed by Shixiong Zhu
Browse files

[SPARK-12376][TESTS] Spark Streaming Java8APISuite fails in assertOrderInvariantEquals method

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

Author: Evan Chen <chene@us.ibm.com>

Closes #10336 from evanyc15/SPARK-12376-StreamingJavaAPISuite.
parent e096a652
No related branches found
No related tags found
No related merge requests found
...@@ -439,9 +439,14 @@ public class Java8APISuite extends LocalJavaStreamingContext implements Serializ ...@@ -439,9 +439,14 @@ public class Java8APISuite extends LocalJavaStreamingContext implements Serializ
*/ */
public static <T extends Comparable<T>> void assertOrderInvariantEquals( public static <T extends Comparable<T>> void assertOrderInvariantEquals(
List<List<T>> expected, List<List<T>> actual) { List<List<T>> expected, List<List<T>> actual) {
expected.forEach((List<T> list) -> Collections.sort(list)); expected.forEach(list -> Collections.sort(list));
actual.forEach((List<T> list) -> Collections.sort(list)); List<List<T>> sortedActual = new ArrayList<>();
Assert.assertEquals(expected, actual); actual.forEach(list -> {
List<T> sortedList = new ArrayList<>(list);
Collections.sort(sortedList);
sortedActual.add(sortedList);
});
Assert.assertEquals(expected, sortedActual);
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment