aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'runners/gradle-plugin')
-rw-r--r--runners/gradle-plugin/build.gradle.kts1
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt9
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt11
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt8
4 files changed, 13 insertions, 16 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts
index c7f34f55..f2401e6a 100644
--- a/runners/gradle-plugin/build.gradle.kts
+++ b/runners/gradle-plugin/build.gradle.kts
@@ -10,6 +10,7 @@ dependencies {
compileOnly(libs.gradlePlugin.kotlin)
compileOnly(libs.gradlePlugin.android)
+ testImplementation(kotlin("test"))
testImplementation(libs.gradlePlugin.kotlin)
testImplementation(libs.gradlePlugin.android)
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
index 9594887c..f354159a 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/ConfigureWithKotlinSourceSetGistTest.kt
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import kotlin.test.Test
import kotlin.test.assertEquals
import org.jetbrains.dokka.gradle.utils.withDependencies_
+import kotlin.test.assertTrue
class ConfigureWithKotlinSourceSetGistTest {
@Test
@@ -18,11 +19,11 @@ class ConfigureWithKotlinSourceSetGistTest {
val f1Jar = project.file("f1.jar")
val f2Jar = project.file("f2.jar")
- check(f1Jar.createNewFile())
- check(f2Jar.createNewFile())
+ assertTrue(f1Jar.createNewFile())
+ assertTrue(f2Jar.createNewFile())
val customSourceRoot = project.file("customSourceRoot")
- check(customSourceRoot.mkdirs())
+ assertTrue(customSourceRoot.mkdirs())
val gist = KotlinSourceSetGist(
name = "customName",
@@ -112,7 +113,7 @@ class ConfigureWithKotlinSourceSetGistTest {
)
val customSourceRoot = project.file("src/main/customRoot")
- check(customSourceRoot.mkdirs())
+ assertTrue(customSourceRoot.mkdirs())
mainSourceSet.kotlin.srcDir(customSourceRoot)
assertEquals(
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
index b5230114..ed00c4b2 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
@@ -7,8 +7,7 @@ import org.jetbrains.dokka.PluginConfigurationImpl
import org.jetbrains.dokka.gradle.utils.create_
import org.jetbrains.dokka.gradle.utils.externalDocumentationLink_
import org.jetbrains.dokka.gradle.utils.withDependencies_
-import org.junit.Rule
-import org.junit.rules.TemporaryFolder
+import org.junit.jupiter.api.io.TempDir
import java.io.File
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
@@ -16,14 +15,10 @@ import java.net.URL
import kotlin.test.Test
import kotlin.test.assertEquals
-@Suppress("UnstableApiUsage")
class DokkaConfigurationSerializableTest {
- @get:Rule
- val temporaryFolder = TemporaryFolder()
-
@Test
- fun `DokkaTask configuration write to file then parse`() {
+ fun `DokkaTask configuration write to file then parse`(@TempDir tempDirectory: File) {
val project = ProjectBuilder.builder().build()
project.plugins.apply("org.jetbrains.dokka")
val dokkaTask = project.tasks.withType<DokkaTask>().first()
@@ -66,7 +61,7 @@ class DokkaConfigurationSerializableTest {
}
val sourceConfiguration = dokkaTask.buildDokkaConfiguration()
- val configurationFile = temporaryFolder.root.resolve("config.bin")
+ val configurationFile = tempDirectory.resolve("config.bin")
ObjectOutputStream(configurationFile.outputStream()).use { stream ->
stream.writeObject(sourceConfiguration)
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
index 88bef2b2..976bff77 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
@@ -145,10 +145,10 @@ class KotlinSourceSetGistTest {
)
/* Creating dependency files */
- check(implementationJar.createNewFile())
- check(compileOnlyJar.createNewFile())
- check(apiJar.createNewFile())
- check(runtimeOnlyJar.createNewFile())
+ assertTrue(implementationJar.createNewFile())
+ assertTrue(compileOnlyJar.createNewFile())
+ assertTrue(apiJar.createNewFile())
+ assertTrue(runtimeOnlyJar.createNewFile())
assertEquals(
setOf(implementationJar, compileOnlyJar, apiJar), mainSourceSetGist.classpath.get().files,