Skip to content

Commit 929dfa2

Browse files
author
Andrew Or
committed
Revert "[SPARK-8781] Fix variables in published pom.xml are not resolved"
This reverts commit 82cf331. Conflicts: pom.xml
1 parent 9eae5fa commit 929dfa2

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

extras/kinesis-asl/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
<artifactId>spark-streaming_${scala.binary.version}</artifactId>
4141
<version>${project.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.apache.spark</groupId>
45+
<artifactId>spark-core_${scala.binary.version}</artifactId>
46+
<version>${project.version}</version>
47+
<type>test-jar</type>
48+
<scope>test</scope>
49+
</dependency>
4350
<dependency>
4451
<groupId>org.apache.spark</groupId>
4552
<artifactId>spark-streaming_${scala.binary.version}</artifactId>

extras/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisReceiverSuite.scala

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,18 @@ import com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionIn
2626
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason
2727
import com.amazonaws.services.kinesis.model.Record
2828
import org.mockito.Mockito._
29-
// scalastyle:off
30-
// To avoid introducing a dependency on Spark core tests, simply use scalatest's FunSuite
31-
// here instead of our own SparkFunSuite. Introducing the dependency has caused problems
32-
// in the past (SPARK-8781) that are complicated by bugs in the maven shade plugin (MSHADE-148).
33-
import org.scalatest.{BeforeAndAfter, FunSuite, Matchers}
29+
import org.scalatest.{BeforeAndAfter, Matchers}
3430
import org.scalatest.mock.MockitoSugar
3531

3632
import org.apache.spark.storage.StorageLevel
37-
import org.apache.spark.streaming.{Milliseconds, Seconds, StreamingContext}
33+
import org.apache.spark.streaming.{Milliseconds, Seconds, StreamingContext, TestSuiteBase}
3834
import org.apache.spark.util.{Clock, ManualClock, Utils}
3935

4036
/**
4137
* Suite of Kinesis streaming receiver tests focusing mostly on the KinesisRecordProcessor
4238
*/
43-
class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter
44-
with MockitoSugar {
45-
// scalastyle:on
39+
class KinesisReceiverSuite extends TestSuiteBase with Matchers with BeforeAndAfter
40+
with MockitoSugar {
4641

4742
val app = "TestKinesisReceiver"
4843
val stream = "mySparkStream"
@@ -62,23 +57,24 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter
6257
var checkpointStateMock: KinesisCheckpointState = _
6358
var currentClockMock: Clock = _
6459

65-
before {
60+
override def beforeFunction(): Unit = {
6661
receiverMock = mock[KinesisReceiver]
6762
checkpointerMock = mock[IRecordProcessorCheckpointer]
6863
checkpointClockMock = mock[ManualClock]
6964
checkpointStateMock = mock[KinesisCheckpointState]
7065
currentClockMock = mock[Clock]
7166
}
7267

73-
after {
68+
override def afterFunction(): Unit = {
69+
super.afterFunction()
7470
// Since this suite was originally written using EasyMock, add this to preserve the old
7571
// mocking semantics (see SPARK-5735 for more details)
7672
verifyNoMoreInteractions(receiverMock, checkpointerMock, checkpointClockMock,
7773
checkpointStateMock, currentClockMock)
7874
}
7975

8076
test("KinesisUtils API") {
81-
val ssc = new StreamingContext("local[2]", getClass.getSimpleName, Seconds(1))
77+
val ssc = new StreamingContext(master, framework, batchDuration)
8278
// Tests the API, does not actually test data receiving
8379
val kinesisStream1 = KinesisUtils.createStream(ssc, "mySparkStream",
8480
"https://kinesis.us-west-2.amazonaws.com", Seconds(2),

0 commit comments

Comments
 (0)