[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (FLINK-11201) flink-test-utils dependency issue

eugen yushin created FLINK-11201:

             Summary: flink-test-utils dependency issue
                 Key: FLINK-11201
                 URL: https://issues.apache.org/jira/browse/FLINK-11201
             Project: Flink
          Issue Type: Bug
          Components: Tests
    Affects Versions: 1.7.0
            Reporter: eugen yushin

Starting with Flink 1.7, there's lack of `runtime.testutils.MiniClusterResource` class in `flink-test-utils` distribution.

Steps to reproduce (Scala code)

name := "flink-17-test-issue"

organization := "x.y.z"
scalaVersion := "2.11.12"
val flinkVersion = "1.7.0"

libraryDependencies ++= Seq(
  "org.apache.flink" %% "flink-streaming-scala" % flinkVersion % Provided,
  "org.scalatest" %% "scalatest" % "3.0.5" % Test,
  "org.apache.flink" %% "flink-test-utils" % flinkVersion % Test
//  ,"org.apache.flink" %% "flink-runtime" % flinkVersion % Test classifier Artifact.TestsClassifier

test class:
class SimpleTest extends AbstractTestBase with FlatSpecLike {
  implicit val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

  "SimpleTest" should "work" in {
    val inputDs = env.fromElements(1,2,3)



Results in:
A needed class was not found. This could be due to an error in your runpath. Missing class: org/apache/flink/runtime/testutils/MiniClusterResource
java.lang.NoClassDefFoundError: org/apache/flink/runtime/testutils/MiniClusterResource
Caused by: java.lang.ClassNotFoundException: org.apache.flink.runtime.testutils.MiniClusterResource
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 31 more

This can be fixed by flink-runtime distribution with test classifier.

This message was sent by Atlassian JIRA