From fa8c752d6a78d1c54717819f37ffe2a0f0ec48a5 Mon Sep 17 00:00:00 2001 From: Jeff Harrison Date: Thu, 16 Jul 2015 16:39:43 -0600 Subject: [PATCH] Correct test text --- .../apache/spark/streaming/StreamingContext.scala | 4 ++-- .../spark/streaming/StreamingListenerSuite.scala | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala b/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala index 49330294611a0..8e9b724c9b4f2 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala @@ -566,8 +566,8 @@ class StreamingContext private[streaming] ( zeroArgumentConstructor.get.newInstance() } else { throw new SparkException( - s"Exception when registering Streaming Listener:" + - " $className did not have a zero-argument constructor or a" + + "Exception when registering Streaming Listener:" + + s" $className did not have a zero-argument constructor or a" + " single-argument constructor that accepts SparkConf. Note: if the class is" + " defined inside of another Scala class, then its constructors may accept an" + " implicit parameter that references the enclosing class; in this case, you must" + diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala index b2975cd0db4ac..3007fea1b9b1e 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala @@ -145,12 +145,15 @@ class StreamingListenerSuite extends TestSuiteBase with Matchers { test("registering listeners via spark.streaming.extraListeners") { // Test for success with zero-argument constructor and sparkConf constructor val conf = new SparkConf().setMaster("local").setAppName("test") - .set("spark.streaming.extraListeners", classOf[StreamingListenerThatAcceptsSparkConf].getName + "," + + .set("spark.streaming.extraListeners", + classOf[StreamingListenerThatAcceptsSparkConf].getName + "," + classOf[ReceiverInfoCollector].getName) val scc = new StreamingContext(conf, Seconds(1)) - scc.scheduler.listenerBus.listeners.exists { _.isInstanceOf[StreamingListenerThatAcceptsSparkConf] } - scc.scheduler.listenerBus.listeners.exists { _.isInstanceOf[ReceiverInfoCollector] } + scc.scheduler.listenerBus.listeners.exists { + _.isInstanceOf[StreamingListenerThatAcceptsSparkConf] } + scc.scheduler.listenerBus.listeners.exists { + _.isInstanceOf[ReceiverInfoCollector] } // Test for failure with too many arguments in constructor val failingConf = new SparkConf().setMaster("local").setAppName("failingTest") @@ -159,8 +162,9 @@ class StreamingListenerSuite extends TestSuiteBase with Matchers { val failingScc = new StreamingContext(failingConf, Seconds(1)) } val expectedErrorMessage = - s"Exception when registering Streaming Listener:" + - " StreamingListenerTooManyArguments did not have a zero-argument constructor or a" + + "Exception when registering Streaming Listener:" + + " org.apache.spark.streaming.StreamingListenerTooManyArguments" + + " did not have a zero-argument constructor or a" + " single-argument constructor that accepts SparkConf. Note: if the class is" + " defined inside of another Scala class, then its constructors may accept an" + " implicit parameter that references the enclosing class; in this case, you must" +