diff options
author | Andrew Or <andrewor14@gmail.com> | 2013-12-26 17:42:13 -0800 |
---|---|---|
committer | Andrew Or <andrewor14@gmail.com> | 2013-12-26 23:40:07 -0800 |
commit | a515706d9cb2c94ed981d9015026331aaf582f36 (patch) | |
tree | 95e0979e50fdede113e8bfe41716affd7817620c /streaming/src/test | |
parent | 1ffe26c7c03b5d128952e7d3ea7f130cd242a468 (diff) | |
download | spark-a515706d9cb2c94ed981d9015026331aaf582f36.tar.gz spark-a515706d9cb2c94ed981d9015026331aaf582f36.tar.bz2 spark-a515706d9cb2c94ed981d9015026331aaf582f36.zip |
Fix streaming JavaAPISuite again
Diffstat (limited to 'streaming/src/test')
-rw-r--r-- | streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java b/streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java index bf23469936..947668369f 100644 --- a/streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java +++ b/streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java @@ -1233,15 +1233,15 @@ public class JavaAPISuite implements Serializable { Arrays.asList("hello", "moon"), Arrays.asList("hello")); - List<List<Tuple2<String, Long>>> expected = Arrays.asList( - Arrays.asList( - new Tuple2<String, Long>("world", 1L), - new Tuple2<String, Long>("hello", 1L)), - Arrays.asList( - new Tuple2<String, Long>("world", 1L), + List<HashSet<Tuple2<String, Long>>> expected = Arrays.asList( + Sets.newHashSet( + new Tuple2<String, Long>("hello", 1L), + new Tuple2<String, Long>("world", 1L)), + Sets.newHashSet( new Tuple2<String, Long>("hello", 2L), + new Tuple2<String, Long>("world", 1L), new Tuple2<String, Long>("moon", 1L)), - Arrays.asList( + Sets.newHashSet( new Tuple2<String, Long>("hello", 2L), new Tuple2<String, Long>("moon", 1L))); @@ -1251,8 +1251,12 @@ public class JavaAPISuite implements Serializable { stream.countByValueAndWindow(new Duration(2000), new Duration(1000)); JavaTestUtils.attachTestOutputStream(counted); List<List<Tuple2<String, Long>>> result = JavaTestUtils.runStreams(ssc, 3, 3); + List<HashSet<Tuple2<String, Long>>> unorderedResult = Lists.newArrayList(); + for (List<Tuple2<String, Long>> res: result) { + unorderedResult.add(Sets.newHashSet(res)); + } - Assert.assertEquals(expected, result); + Assert.assertEquals(expected, unorderedResult); } @Test |