You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Juan Rodríguez Hortalá <ju...@gmail.com> on 2019/07/23 04:49:35 UTC

MiniClusterResource class not found using AbstractTestBase

Hi,

I'm trying to use AbstractTestBase in a test in order to use the mini
cluster. I'm using specs2 with Scala, so I cannot extend AbstractTestBase
because I also have to extend org.specs2.Specification, so I'm trying to
access the mini cluster directly using Specs2 BeforeAll to initialize it as
follows

private val miniClusterResource = AbstractTestBase.miniClusterResource
miniClusterResource.before()


The problem is that the code doesn't even compile, because it fails to
locate `org.apache.flink.runtime.testutils.MiniClusterResource`

```
[warn] Class org.apache.flink.runtime.testutils.MiniClusterResource not
found - continuing with a stub.
[warn] Class
org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration not
found - continuing with a stub.
[error] Class org.apache.flink.runtime.testutils.MiniClusterResource not
found - continuing with a stub.
[warn] two warnings found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 1 s, completed Jul 22, 2019 9:38:49 PM
```

I'm importing the following libraries in build.sbt

"org.apache.flink" %% "flink-test-utils"  % flinkVersion,
"org.apache.flink" %% "flink-runtime"  % flinkVersion


Am I missing some additional library?

Thanks,

Juan

Re: Re: MiniClusterResource class not found using AbstractTestBase

Posted by Juan Rodríguez Hortalá <ju...@gmail.com>.
Using that classifier worked, the code builds fine now, thanks a lot. I'm
using 1.8.0 by the way

Greetings,

Juan

On Tue, Jul 23, 2019 at 5:06 AM Haibo Sun <su...@163.com> wrote:

> Hi,  Juan
>
> It is dependent on "flink-runtime-*-tests.jar", so build.sbt should be
> modified as follows:
>
> *scalaVersion := "2.11.0"*
>
> *val flinkVersion = "1.8.1"*
>
> *libraryDependencies ++= Seq(*
> *  "org.apache.flink" %% "flink-test-utils" % flinkVersion % Test,*
> *  "org.apache.flink" %% "flink-runtime" % flinkVersion % Test **classifier
> "tests"*
> *)*
>
> Best,
> Haibo
>
> At 2019-07-23 17:51:23, "Fabian Hueske" <fh...@gmail.com> wrote:
>
> Hi Juan,
>
> Which Flink version do you use?
>
> Best, Fabian
>
> Am Di., 23. Juli 2019 um 06:49 Uhr schrieb Juan Rodríguez Hortalá <
> juan.rodriguez.hortala@gmail.com>:
>
>> Hi,
>>
>> I'm trying to use AbstractTestBase in a test in order to use the mini
>> cluster. I'm using specs2 with Scala, so I cannot extend AbstractTestBase
>> because I also have to extend org.specs2.Specification, so I'm trying to
>> access the mini cluster directly using Specs2 BeforeAll to initialize it as
>> follows
>>
>> private val miniClusterResource = AbstractTestBase.miniClusterResource
>> miniClusterResource.before()
>>
>>
>> The problem is that the code doesn't even compile, because it fails to
>> locate `org.apache.flink.runtime.testutils.MiniClusterResource`
>>
>> ```
>> [warn] Class org.apache.flink.runtime.testutils.MiniClusterResource not
>> found - continuing with a stub.
>> [warn] Class
>> org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration not
>> found - continuing with a stub.
>> [error] Class org.apache.flink.runtime.testutils.MiniClusterResource not
>> found - continuing with a stub.
>> [warn] two warnings found
>> [error] one error found
>> [error] (Compile / compileIncremental) Compilation failed
>> [error] Total time: 1 s, completed Jul 22, 2019 9:38:49 PM
>> ```
>>
>> I'm importing the following libraries in build.sbt
>>
>> "org.apache.flink" %% "flink-test-utils"  % flinkVersion,
>> "org.apache.flink" %% "flink-runtime"  % flinkVersion
>>
>>
>> Am I missing some additional library?
>>
>> Thanks,
>>
>> Juan
>>
>

Re:Re: MiniClusterResource class not found using AbstractTestBase

Posted by Haibo Sun <su...@163.com>.
Hi,  Juan  


It is dependent on "flink-runtime-*-tests.jar", so build.sbt should be modified as follows: 


scalaVersion := "2.11.0"


val flinkVersion = "1.8.1"


libraryDependencies ++= Seq(
  "org.apache.flink" %% "flink-test-utils" % flinkVersion % Test,
  "org.apache.flink" %% "flink-runtime" % flinkVersion % Test classifier "tests"
)


Best,
Haibo

At 2019-07-23 17:51:23, "Fabian Hueske" <fh...@gmail.com> wrote:

Hi Juan,


Which Flink version do you use?


Best, Fabian



Am Di., 23. Juli 2019 um 06:49 Uhr schrieb Juan Rodríguez Hortalá <ju...@gmail.com>:

Hi,



I'm trying to use AbstractTestBase in a test in order to use the mini cluster. I'm using specs2 with Scala, so I cannot extend AbstractTestBase because I also have to extend org.specs2.Specification, so I'm trying to access the mini cluster directly using Specs2 BeforeAll to initialize it as follows



private val miniClusterResource = AbstractTestBase.miniClusterResource
miniClusterResource.before()


The problem is that the code doesn't even compile, because it fails to locate `org.apache.flink.runtime.testutils.MiniClusterResource`


```

[warn] Class org.apache.flink.runtime.testutils.MiniClusterResource not found - continuing with a stub.
[warn] Class org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration not found - continuing with a stub.
[error] Class org.apache.flink.runtime.testutils.MiniClusterResource not found - continuing with a stub.
[warn] two warnings found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 1 s, completed Jul 22, 2019 9:38:49 PM
```



I'm importing the following libraries in build.sbt


"org.apache.flink" %% "flink-test-utils"  % flinkVersion,
"org.apache.flink" %% "flink-runtime"  % flinkVersion


Am I missing some additional library?


Thanks,



Juan

Re: MiniClusterResource class not found using AbstractTestBase

Posted by Fabian Hueske <fh...@gmail.com>.
Hi Juan,

Which Flink version do you use?

Best, Fabian

Am Di., 23. Juli 2019 um 06:49 Uhr schrieb Juan Rodríguez Hortalá <
juan.rodriguez.hortala@gmail.com>:

> Hi,
>
> I'm trying to use AbstractTestBase in a test in order to use the mini
> cluster. I'm using specs2 with Scala, so I cannot extend AbstractTestBase
> because I also have to extend org.specs2.Specification, so I'm trying to
> access the mini cluster directly using Specs2 BeforeAll to initialize it as
> follows
>
> private val miniClusterResource = AbstractTestBase.miniClusterResource
> miniClusterResource.before()
>
>
> The problem is that the code doesn't even compile, because it fails to
> locate `org.apache.flink.runtime.testutils.MiniClusterResource`
>
> ```
> [warn] Class org.apache.flink.runtime.testutils.MiniClusterResource not
> found - continuing with a stub.
> [warn] Class
> org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration not
> found - continuing with a stub.
> [error] Class org.apache.flink.runtime.testutils.MiniClusterResource not
> found - continuing with a stub.
> [warn] two warnings found
> [error] one error found
> [error] (Compile / compileIncremental) Compilation failed
> [error] Total time: 1 s, completed Jul 22, 2019 9:38:49 PM
> ```
>
> I'm importing the following libraries in build.sbt
>
> "org.apache.flink" %% "flink-test-utils"  % flinkVersion,
> "org.apache.flink" %% "flink-runtime"  % flinkVersion
>
>
> Am I missing some additional library?
>
> Thanks,
>
> Juan
>