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/src/main/kotlin/org/jetbrains | |
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/src/main/kotlin/org/jetbrains')
-rw-r--r-- | integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt | 12 | ||||
-rw-r--r-- | integration-tests/src/main/kotlin/org/jetbrains/dokka/it/TestOutputCopier.kt | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt index adc75f43..1eb11cfe 100644 --- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt @@ -1,10 +1,7 @@ package org.jetbrains.dokka.it import org.jsoup.Jsoup -import org.junit.Rule -import org.junit.rules.TemporaryFolder -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 +import org.junit.jupiter.api.io.TempDir import java.io.File import java.net.URL import kotlin.test.assertEquals @@ -12,13 +9,12 @@ import kotlin.test.assertFalse import kotlin.test.assertNotNull import kotlin.test.assertTrue -@RunWith(JUnit4::class) abstract class AbstractIntegrationTest { - @get:Rule - val temporaryTestFolder = TemporaryFolder() + @field:TempDir + lateinit var tempFolder: File - val projectDir get() = File(temporaryTestFolder.root, "project") + val projectDir get() = File(tempFolder, "project") fun File.allDescendentsWithExtension(extension: String): Sequence<File> = this.walkTopDown().filter { it.isFile && it.extension == extension } diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/TestOutputCopier.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/TestOutputCopier.kt index 30770838..54712851 100644 --- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/TestOutputCopier.kt +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/TestOutputCopier.kt @@ -1,12 +1,12 @@ package org.jetbrains.dokka.it -import org.junit.After import java.io.File +import kotlin.test.AfterTest interface TestOutputCopier { val projectOutputLocation: File - @After + @AfterTest fun copyToLocation() { System.getenv("DOKKA_TEST_OUTPUT_PATH")?.also { location -> println("Copying to ${File(location).absolutePath}") |