Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7413#discussion_r34826834
  
    --- Diff: 
extras/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala
 ---
    @@ -0,0 +1,105 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.streaming.kinesis
    +
    +import scala.collection.mutable
    +import scala.concurrent.duration._
    +import scala.language.postfixOps
    +import scala.util.Random
    +
    +import 
com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream
    +import org.scalatest.concurrent.Eventually
    +import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll}
    +
    +import org.apache.spark.storage.StorageLevel
    +import org.apache.spark.streaming._
    +import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite}
    +
    +class KinesisStreamSuite extends SparkFunSuite with KinesisSuiteHelper
    +  with Eventually with BeforeAndAfter with BeforeAndAfterAll {
    +
    +  private val kinesisTestUtils = new KinesisTestUtils()
    +
    +  // This is the name that KCL uses to save metadata to DynamoDB
    +  private val kinesisAppName = 
s"KinesisStreamSuite-${math.abs(Random.nextLong())}"
    +
    +  private var ssc: StreamingContext = _
    +  private var sc: SparkContext = _
    +
    +  override def beforeAll(): Unit = {
    +    kinesisTestUtils.createStream()
    +    val conf = new SparkConf()
    +      .setMaster("local[4]")
    +      .setAppName("KinesisStreamSuite") // Setting Spark app name to 
Kinesis app name
    +    sc = new SparkContext(conf)
    +  }
    +
    +  override def afterAll(): Unit = {
    +    sc.stop()
    +    // Delete the stream as well as the table
    +    kinesisTestUtils.deleteStream()
    +    kinesisTestUtils.deleteDynamoDBTable(kinesisAppName)
    +  }
    +
    +  before {
    +    // Delete the table so that each unit test can start from scratch 
without prior state
    +    kinesisTestUtils.deleteDynamoDBTable(kinesisAppName)
    +  }
    +
    +  after {
    +    if (ssc != null) {
    +      ssc.stop(stopSparkContext = false)
    +      ssc = null
    +    }
    +  }
    +
    +  test("API") {
    --- End diff --
    
    Yes, I forgot to remove that unit test, good point. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to