Skip to content
Snippets Groups Projects
Commit d6d91047 authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #333 from rxin/master

Fixed the broken Java unit test from SPARK-635.
parents 05e225f9 f4a9e1b9
No related branches found
No related tags found
No related merge requests found
package spark; package spark;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.*;
import scala.Tuple2;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.io.Files; import com.google.common.io.Files;
import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.IntWritable;
...@@ -12,8 +19,6 @@ import org.junit.Assert; ...@@ -12,8 +19,6 @@ import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import scala.Tuple2;
import spark.api.java.JavaDoubleRDD; import spark.api.java.JavaDoubleRDD;
import spark.api.java.JavaPairRDD; import spark.api.java.JavaPairRDD;
import spark.api.java.JavaRDD; import spark.api.java.JavaRDD;
...@@ -24,10 +29,6 @@ import spark.partial.PartialResult; ...@@ -24,10 +29,6 @@ import spark.partial.PartialResult;
import spark.storage.StorageLevel; import spark.storage.StorageLevel;
import spark.util.StatCounter; import spark.util.StatCounter;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.*;
// The test suite itself is Serializable so that anonymous Function implementations can be // The test suite itself is Serializable so that anonymous Function implementations can be
// serialized, as an alternative to converting these anonymous classes to static inner classes; // serialized, as an alternative to converting these anonymous classes to static inner classes;
...@@ -383,7 +384,8 @@ public class JavaAPISuite implements Serializable { ...@@ -383,7 +384,8 @@ public class JavaAPISuite implements Serializable {
@Test @Test
public void iterator() { public void iterator() {
JavaRDD<Integer> rdd = sc.parallelize(Arrays.asList(1, 2, 3, 4, 5), 2); JavaRDD<Integer> rdd = sc.parallelize(Arrays.asList(1, 2, 3, 4, 5), 2);
Assert.assertEquals(1, rdd.iterator(rdd.splits().get(0)).next().intValue()); TaskContext context = new TaskContext(0, 0, 0);
Assert.assertEquals(1, rdd.iterator(rdd.splits().get(0), context).next().intValue());
} }
@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