You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by zavalit <za...@gmail.com> on 2018/03/16 14:36:12 UTC

Intergrations Test in Scala

hi, Flinkers
i've already posted by stackoverflow, but there are still no that match
feedback about the problem
https://stackoverflow.com/questions/49155762/failing-to-trigger-streamingmultipleprogramstestbase-test-in-scala/49258997#49258997

Problem: i cannot start any test extending
*StreamingMultipleProgramsTestBase*

here are my dependiencies:

val flinkVersion = "1.4.0"

val flinkDependencies = Seq(
  "org.apache.flink" %% "flink-scala" % flinkVersion % "provided",
  "org.apache.flink" %% "flink-streaming-scala" % flinkVersion % "provided",
  "org.apache.flink" %% "flink-connector-rabbitmq" % flinkVersion %
"provided",
  "org.apache.flink" %% "flink-connector-kafka-0.11" % flinkVersion %
"provided",
  "org.apache.flink" %% "flink-test-utils" % flinkVersion % "provided",
  "org.scalatest" % "scalatest_2.11" % "3.0.5" % "test"
)



and here is my sample test:

    import java.util
    import java.lang.Long

    import com.google.common.collect.Lists
    import org.apache.flink.api.common.functions.MapFunction
    import org.apache.flink.streaming.api.functions.sink.SinkFunction
    import org.apache.flink.streaming.api.scala.{DataStream,
StreamExecutionEnvironment}
    import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase
    import org.apache.flink.api.common.typeinfo.TypeInformation
    import org.junit.Test
    import org.apache.flink.api.scala._
    import org.apache.flink.api.scala.extensions._
    import org.apache.flink.streaming.api.scala.extensions._
    import org.junit.Assert.assertEquals
    import scala.collection.JavaConversions._
    import org.scalatest._



    class HotelSearchIntegrationTest extends
StreamingMultipleProgramsTestBase{

      @Test
      def testMatching(): Unit = {
        val env = StreamExecutionEnvironment.getExecutionEnvironment
        env.setParallelism(1)

        // create a stream of custom elements and apply transformations
        env
          .fromElements(1L)
          .map( v => v).addSink( v => println(s"v"))

        // execute
        env.execute()

        assertEquals(1L, 1L)

      }

    }



after a run
$ sbt test

i get :
[info] No tests were executed.

thanks for any hint




--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/