Use internal methods in JVM Test Suite Plugin

Hello,

I wanted to ask if it’s possible to use internal methods in a jvmTestSuite?

I can only use internal methods in regular test sources.

Thanks in advance

For that question you should probably specify what “internal” means / which context you are talking about.
And then I might send you off to a community for that context, for example asking in the Kotlin Slack if your question is about Kotlin.

Because if you ask about Gradle and whether you can use internal, the answer is no, internal classes can be changed any time or vanish completely in any minor release of Gradle. But that is most likely not what you meant. :slight_smile:

Besides that, there are no “regular test sources”, the “test” source set sources are also a JVM test suite with name test under the hood.

Thank you for explaining the test JVM test suite part.

I am sorry for being not accurate enough.
I am talking about the visibility modifier “internal” in Kotlin.

Is it possible that I can also use an internal Kotlin method in other JVM test suites as well? Currently I can only use it in the test JVM test suite.

*Edit: This is how it will work:

Please be aware of order.

testing {
    suites {
            val integrationTest by registering(JvmTestSuite::class) {
        }
    }
}
kotlin {
    target.compilations {
        val main by getting
        val integrationTest by getting {
            associateWith(main) // make internal methods callable, see main dependencies
        }
    }
}

I have no idea.
As I suggested above, you should ask in the Kotlin community where the experts around Kotlin hang around more than here.
This is not so much a Gradle question. :slight_smile:

1 Like