Skip to content
Snippets Groups Projects
Commit 929dfa24 authored by Andrew Or's avatar Andrew Or
Browse files

Revert "[SPARK-8781] Fix variables in published pom.xml are not resolved"

This reverts commit 82cf3315.

Conflicts:
	pom.xml
parent 9eae5fa6
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,13 @@ ...@@ -40,6 +40,13 @@
<artifactId>spark-streaming_${scala.binary.version}</artifactId> <artifactId>spark-streaming_${scala.binary.version}</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.spark</groupId> <groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_${scala.binary.version}</artifactId> <artifactId>spark-streaming_${scala.binary.version}</artifactId>
......
...@@ -26,23 +26,18 @@ import com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionIn ...@@ -26,23 +26,18 @@ import com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionIn
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason
import com.amazonaws.services.kinesis.model.Record import com.amazonaws.services.kinesis.model.Record
import org.mockito.Mockito._ import org.mockito.Mockito._
// scalastyle:off import org.scalatest.{BeforeAndAfter, Matchers}
// To avoid introducing a dependency on Spark core tests, simply use scalatest's FunSuite
// here instead of our own SparkFunSuite. Introducing the dependency has caused problems
// in the past (SPARK-8781) that are complicated by bugs in the maven shade plugin (MSHADE-148).
import org.scalatest.{BeforeAndAfter, FunSuite, Matchers}
import org.scalatest.mock.MockitoSugar import org.scalatest.mock.MockitoSugar
import org.apache.spark.storage.StorageLevel import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming.{Milliseconds, Seconds, StreamingContext} import org.apache.spark.streaming.{Milliseconds, Seconds, StreamingContext, TestSuiteBase}
import org.apache.spark.util.{Clock, ManualClock, Utils} import org.apache.spark.util.{Clock, ManualClock, Utils}
/** /**
* Suite of Kinesis streaming receiver tests focusing mostly on the KinesisRecordProcessor * Suite of Kinesis streaming receiver tests focusing mostly on the KinesisRecordProcessor
*/ */
class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter class KinesisReceiverSuite extends TestSuiteBase with Matchers with BeforeAndAfter
with MockitoSugar { with MockitoSugar {
// scalastyle:on
val app = "TestKinesisReceiver" val app = "TestKinesisReceiver"
val stream = "mySparkStream" val stream = "mySparkStream"
...@@ -62,7 +57,7 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter ...@@ -62,7 +57,7 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter
var checkpointStateMock: KinesisCheckpointState = _ var checkpointStateMock: KinesisCheckpointState = _
var currentClockMock: Clock = _ var currentClockMock: Clock = _
before { override def beforeFunction(): Unit = {
receiverMock = mock[KinesisReceiver] receiverMock = mock[KinesisReceiver]
checkpointerMock = mock[IRecordProcessorCheckpointer] checkpointerMock = mock[IRecordProcessorCheckpointer]
checkpointClockMock = mock[ManualClock] checkpointClockMock = mock[ManualClock]
...@@ -70,7 +65,8 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter ...@@ -70,7 +65,8 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter
currentClockMock = mock[Clock] currentClockMock = mock[Clock]
} }
after { override def afterFunction(): Unit = {
super.afterFunction()
// Since this suite was originally written using EasyMock, add this to preserve the old // Since this suite was originally written using EasyMock, add this to preserve the old
// mocking semantics (see SPARK-5735 for more details) // mocking semantics (see SPARK-5735 for more details)
verifyNoMoreInteractions(receiverMock, checkpointerMock, checkpointClockMock, verifyNoMoreInteractions(receiverMock, checkpointerMock, checkpointClockMock,
...@@ -78,7 +74,7 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter ...@@ -78,7 +74,7 @@ class KinesisReceiverSuite extends FunSuite with Matchers with BeforeAndAfter
} }
test("KinesisUtils API") { test("KinesisUtils API") {
val ssc = new StreamingContext("local[2]", getClass.getSimpleName, Seconds(1)) val ssc = new StreamingContext(master, framework, batchDuration)
// Tests the API, does not actually test data receiving // Tests the API, does not actually test data receiving
val kinesisStream1 = KinesisUtils.createStream(ssc, "mySparkStream", val kinesisStream1 = KinesisUtils.createStream(ssc, "mySparkStream",
"https://kinesis.us-west-2.amazonaws.com", Seconds(2), "https://kinesis.us-west-2.amazonaws.com", Seconds(2),
......
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