diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-30 15:58:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 15:58:46 +0200 |
commit | c63ea36637ce956029fb15b1482c0683ecb8a587 (patch) | |
tree | 2b75a8a976b43530820e73dc60cce4b10d9fc005 /integration-tests/gradle/src/main/kotlin/org | |
parent | 0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 (diff) | |
download | dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.gz dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.bz2 dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.zip |
Migrate to JUnit 5 and unify used test API (#3138)
Diffstat (limited to 'integration-tests/gradle/src/main/kotlin/org')
-rw-r--r-- | integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt index 43cc575b..5caecafd 100644 --- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt @@ -6,40 +6,35 @@ import org.gradle.testkit.runner.internal.DefaultGradleRunner import org.gradle.tooling.GradleConnectionException import org.gradle.util.GradleVersion import org.jetbrains.dokka.it.AbstractIntegrationTest -import org.junit.AssumptionViolatedException -import org.junit.runner.RunWith -import org.junit.runners.Parameterized import java.io.File import java.net.URI import kotlin.test.BeforeTest -@RunWith(Parameterized::class) abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() { - abstract val versions: BuildVersions - @BeforeTest fun copyTemplates() { File("projects").listFiles().orEmpty() .filter { it.isFile } .filter { it.name.startsWith("template.") } - .forEach { file -> file.copyTo(File(temporaryTestFolder.root, file.name)) } + .forEach { file -> file.copyTo(File(tempFolder, file.name)) } } fun createGradleRunner( + buildVersions: BuildVersions, vararg arguments: String, jvmArgs: List<String> = listOf("-Xmx2G", "-XX:MaxMetaspaceSize=1G") ): GradleRunner { return GradleRunner.create() .withProjectDir(projectDir) .forwardOutput() - .withJetBrainsCachedGradleVersion(versions.gradleVersion) + .withJetBrainsCachedGradleVersion(buildVersions.gradleVersion) .withTestKitDir(File("build", "gradle-test-kit").absoluteFile) .withArguments( listOfNotNull( - "-Pkotlin_version=${versions.kotlinVersion}", - "-Pdokka_it_kotlin_version=${versions.kotlinVersion}", - versions.androidGradlePluginVersion?.let { androidVersion -> + "-Pkotlin_version=${buildVersions.kotlinVersion}", + "-Pdokka_it_kotlin_version=${buildVersions.kotlinVersion}", + buildVersions.androidGradlePluginVersion?.let { androidVersion -> "-Pdokka_it_android_gradle_plugin_version=$androidVersion" }, * arguments @@ -55,7 +50,7 @@ abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() { val gradleConnectionException = e.withAllCauses().find { it is GradleConnectionException } if (gradleConnectionException != null) { gradleConnectionException.printStackTrace() - throw AssumptionViolatedException("Assumed Gradle connection", gradleConnectionException) + throw IllegalStateException("Assumed Gradle connection", gradleConnectionException) } throw e |