Skip to content

Commit 4559310

Browse files
committed
Minor changes for Kafka unit test
1 parent 860f649 commit 4559310

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

external/kafka/src/test/java/org/apache/spark/streaming/kafka/JavaKafkaStreamSuite.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.apache.spark.streaming.api.java.JavaStreamingContext;
3737

3838
import org.junit.Test;
39-
import org.junit.Ignore;
4039
import org.junit.After;
4140
import org.junit.Before;
4241

@@ -48,7 +47,7 @@ public class JavaKafkaStreamSuite extends LocalJavaStreamingContext implements S
4847
public void setUp() {
4948
testSuite.beforeFunction();
5049
System.clearProperty("spark.driver.port");
51-
System.setProperty("spark.streaming.clock", "org.apache.spark.streaming.util.SystemClock");
50+
//System.setProperty("spark.streaming.clock", "org.apache.spark.streaming.util.SystemClock");
5251
ssc = new JavaStreamingContext("local[2]", "test", new Duration(1000));
5352
}
5453

@@ -61,7 +60,7 @@ public void tearDown() {
6160
testSuite.afterFunction();
6261
}
6362

64-
@Ignore @Test
63+
@Test
6564
public void testKafkaStream() {
6665
String topic = "topic1";
6766
HashMap<String, Integer> topics = new HashMap<String, Integer>();

external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaStreamSuite.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class KafkaStreamSuite extends TestSuiteBase {
4848
val brokerConf = new KafkaConfig(brokerProps)
4949
var server: KafkaServer = _
5050

51+
override def useManualClock = false
52+
5153
override def beforeFunction() {
5254
// Zookeeper server startup
5355
zookeeper = new EmbeddedZookeeper(zkConnect)
@@ -75,7 +77,7 @@ class KafkaStreamSuite extends TestSuiteBase {
7577
super.afterFunction()
7678
}
7779

78-
ignore("kafka input stream") {
80+
test("kafka input stream") {
7981
val ssc = new StreamingContext(master, framework, batchDuration)
8082
val topic = "topic1"
8183
val sent = Map("a" -> 5, "b" -> 3, "c" -> 10)

0 commit comments

Comments
 (0)