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 /plugins/base/src/test/kotlin | |
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 'plugins/base/src/test/kotlin')
113 files changed, 448 insertions, 422 deletions
diff --git a/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt b/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt index 70d26e3c..81139300 100644 --- a/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt +++ b/plugins/base/src/test/kotlin/basic/AbortGracefullyOnMissingDocumentablesTest.kt @@ -2,7 +2,7 @@ package basic import org.jetbrains.dokka.DokkaGenerator import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertTrue class AbortGracefullyOnMissingDocumentablesTest: BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index c70c1b0b..794adc9f 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -9,9 +9,8 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.MemberPageNode -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Tag -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals class DRITest : BaseAbstractTest() { @Test diff --git a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt index d4e307be..dca0ffd5 100644 --- a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt +++ b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt @@ -3,7 +3,7 @@ package basic import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals class DokkaBasicTests : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt b/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt index bd8a79ef..1ea2adfd 100644 --- a/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt +++ b/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt @@ -6,8 +6,8 @@ import org.jetbrains.dokka.testApi.logger.TestLogger import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.dokka.utilities.LoggingLevel -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows +import kotlin.test.Test +import kotlin.test.assertFailsWith class FailOnWarningTest : BaseAbstractTest() { @@ -22,7 +22,7 @@ class FailOnWarningTest : BaseAbstractTest() { } } - assertThrows<DokkaException> { + assertFailsWith<DokkaException> { testInline( """ |/src/main/kotlin/Bar.kt @@ -48,7 +48,7 @@ class FailOnWarningTest : BaseAbstractTest() { } } - assertThrows<DokkaException> { + assertFailsWith<DokkaException> { testInline( """ |/src/main/kotlin/Bar.kt diff --git a/plugins/base/src/test/kotlin/basic/LoggerTest.kt b/plugins/base/src/test/kotlin/basic/LoggerTest.kt index 92ffb539..904645ad 100644 --- a/plugins/base/src/test/kotlin/basic/LoggerTest.kt +++ b/plugins/base/src/test/kotlin/basic/LoggerTest.kt @@ -3,7 +3,7 @@ package basic import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.LoggingLevel import org.jetbrains.dokka.utilities.MessageEmitter -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue @@ -41,4 +41,4 @@ class LoggerTest { assertFalse(emitter.messages.any { it.contains("Info!") }) assertTrue(emitter.messages.any { it.contains("Warning!") }) } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt b/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt index e5533a7e..eb04a258 100644 --- a/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt +++ b/plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt @@ -2,7 +2,7 @@ package content import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.doc.* -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -135,4 +135,4 @@ class ContentInDescriptionTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/HighlightingTest.kt b/plugins/base/src/test/kotlin/content/HighlightingTest.kt index 0896e7b7..4de680db 100644 --- a/plugins/base/src/test/kotlin/content/HighlightingTest.kt +++ b/plugins/base/src/test/kotlin/content/HighlightingTest.kt @@ -3,7 +3,7 @@ package content import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertTrue class HighlightingTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 82159e0d..582d2e19 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -9,8 +9,12 @@ import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentText import org.jetbrains.dokka.pages.MemberPageNode import org.jetbrains.dokka.pages.PackagePageNode -import org.junit.jupiter.api.Test -import utils.* +import utils.ParamAttributes +import utils.assertNotNull +import utils.bareSignature +import utils.propertySignature +import utils.JavaCode +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt index c25c1a1b..95935d0e 100644 --- a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt @@ -8,11 +8,12 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentStyle -import org.junit.jupiter.api.Test -import utils.JavaCode import utils.pWrapped +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertNotNull import kotlin.test.assertTrue +import utils.JavaCode @JavaCode class JavaDeprecatedTest : BaseAbstractTest() { @@ -48,7 +49,7 @@ class JavaDeprecatedTest : BaseAbstractTest() { assertTrue(isDeprecated) val deprecatedAnnotation = (deprecatedClass as WithExtraProperties<out Documentable>).deprecatedAnnotation - checkNotNull(deprecatedAnnotation) + assertNotNull(deprecatedAnnotation) assertTrue(deprecatedAnnotation.isDeprecated()) assertEquals("java.lang", deprecatedAnnotation.dri.packageName) diff --git a/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt b/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt index 417843e2..b1e6516c 100644 --- a/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt @@ -8,11 +8,12 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentStyle -import org.junit.jupiter.api.Test import utils.ParamAttributes import utils.bareSignature import utils.pWrapped +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertNotNull import kotlin.test.assertTrue @@ -51,7 +52,7 @@ class KotlinDeprecatedTest : BaseAbstractTest() { assertTrue(isDeprecated) val deprecatedAnnotation = (deprecatedFunction as WithExtraProperties<out Documentable>).deprecatedAnnotation - checkNotNull(deprecatedAnnotation) + assertNotNull(deprecatedAnnotation) assertTrue(deprecatedAnnotation.isDeprecated()) assertEquals("kotlin", deprecatedAnnotation.dri.packageName) diff --git a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt index 0b36031c..87b5c2fb 100644 --- a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt @@ -9,15 +9,12 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.doc.CustomTagWrapper import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.pages.ContentPage -import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test import signatures.AbstractRenderingTest import utils.ParamAttributes import utils.TestOutputWriterPlugin import utils.assertNotNull import utils.bareSignature -import kotlin.test.assertEquals +import kotlin.test.* class SinceKotlinTest : AbstractRenderingTest() { @@ -31,23 +28,23 @@ class SinceKotlinTest : AbstractRenderingTest() { } } - @BeforeEach + @BeforeTest fun setSystemProperty() { System.setProperty(SinceKotlinTransformer.SHOULD_DISPLAY_SINCE_KOTLIN_SYS_PROP, "true") } - @AfterEach + @AfterTest fun clearSystemProperty() { System.clearProperty(SinceKotlinTransformer.SHOULD_DISPLAY_SINCE_KOTLIN_SYS_PROP) } @Test fun versionsComparing() { - assert(SinceKotlinVersion("1.0").compareTo(SinceKotlinVersion("1.0")) == 0) - assert(SinceKotlinVersion("1.0.0").compareTo(SinceKotlinVersion("1")) == 0) - assert(SinceKotlinVersion("1.0") >= SinceKotlinVersion("1.0")) - assert(SinceKotlinVersion("1.1") > SinceKotlinVersion("1")) - assert(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.0")) - assert(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.2")) + assertTrue(SinceKotlinVersion("1.0").compareTo(SinceKotlinVersion("1.0")) == 0) + assertTrue(SinceKotlinVersion("1.0.0").compareTo(SinceKotlinVersion("1")) == 0) + assertTrue(SinceKotlinVersion("1.0") >= SinceKotlinVersion("1.0")) + assertTrue(SinceKotlinVersion("1.1") > SinceKotlinVersion("1")) + assertTrue(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.0")) + assertTrue(SinceKotlinVersion("1.0") < SinceKotlinVersion("2.2")) } @Test @@ -77,7 +74,7 @@ class SinceKotlinTest : AbstractRenderingTest() { ) { renderingStage = { _, _ -> val content = writerPlugin.renderedContent("root/test/index.html") - assert(content.getElementsContainingOwnText("Since Kotlin").count() == 4) + assertEquals(4, content.getElementsContainingOwnText("Since Kotlin").count()) } } } diff --git a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt index 17bd209e..227c4e9e 100644 --- a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt +++ b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt @@ -6,8 +6,11 @@ import org.jetbrains.dokka.PluginConfigurationImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DisplaySourceSet -import org.junit.jupiter.api.Test -import utils.* +import utils.ParamAttributes +import utils.bareSignature +import utils.findTestType +import utils.OnlyDescriptors +import kotlin.test.Test import kotlin.test.assertEquals class ContentForExceptions : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/functions/ContentForBriefTest.kt b/plugins/base/src/test/kotlin/content/functions/ContentForBriefTest.kt index c09a0e4d..d1bfa767 100644 --- a/plugins/base/src/test/kotlin/content/functions/ContentForBriefTest.kt +++ b/plugins/base/src/test/kotlin/content/functions/ContentForBriefTest.kt @@ -7,8 +7,8 @@ import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -381,4 +381,4 @@ class ContentForBriefTest : BaseAbstractTest() { val row = contentTable.children.first() return row.dfs { it is ContentGroup && it.dci.kind == ContentKind.Comment && it.children.all { it is ContentText } } as ContentGroup } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt b/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt index 8da3be54..47b000ac 100644 --- a/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt +++ b/plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt @@ -4,8 +4,9 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Test +import utils.assertContains import utils.assertNotNull +import kotlin.test.Test import kotlin.test.assertEquals class ContentForConstructors : BaseAbstractTest() { @@ -41,8 +42,8 @@ class ContentForConstructors : BaseAbstractTest() { val constructorName = primary.dfs { (it as? ContentText)?.text == "Example" }.assertNotNull("constructorName") - assert(ContentStyle.RowTitle in constructorName.style) + assertContains(constructorName.style, ContentStyle.RowTitle) } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt index 2994fb42..5ec1ca74 100644 --- a/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt +++ b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt @@ -5,10 +5,10 @@ import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.PluginConfigurationImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import utils.OnlyDescriptors import utils.classSignature import utils.findTestType +import kotlin.test.Test import kotlin.test.assertEquals class ContentForInheritorsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt index df5efd03..97114dbc 100644 --- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt +++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt @@ -10,8 +10,8 @@ import org.jetbrains.dokka.model.doc.Param import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.firstIsInstanceOrNull -import org.junit.jupiter.api.Test import utils.* +import kotlin.test.Test import kotlin.test.assertEquals class ContentForParamsTest : BaseAbstractTest() { @@ -1515,10 +1515,10 @@ class ContentForParamsTest : BaseAbstractTest() { it.documentation[jvm] } - assert(forJvm.size == 2) + assertEquals(2, forJvm.size) val (first, second) = forJvm.map { it.paramsDescription() } - assert(first == "comment to first param") - assert(second == "comment to second param") + assertEquals("comment to first param", first) + assertEquals("comment to second param", second) } } } diff --git a/plugins/base/src/test/kotlin/content/properties/ContentForClassWithParamsAndPropertiesTest.kt b/plugins/base/src/test/kotlin/content/properties/ContentForClassWithParamsAndPropertiesTest.kt index 164fa62d..e4abb9af 100644 --- a/plugins/base/src/test/kotlin/content/properties/ContentForClassWithParamsAndPropertiesTest.kt +++ b/plugins/base/src/test/kotlin/content/properties/ContentForClassWithParamsAndPropertiesTest.kt @@ -6,7 +6,7 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.RootPageNode -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals class ContentForClassWithParamsAndPropertiesTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/receiver/ContentForReceiverTest.kt b/plugins/base/src/test/kotlin/content/receiver/ContentForReceiverTest.kt index d7399914..0187b9a7 100644 --- a/plugins/base/src/test/kotlin/content/receiver/ContentForReceiverTest.kt +++ b/plugins/base/src/test/kotlin/content/receiver/ContentForReceiverTest.kt @@ -7,8 +7,8 @@ import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.pages.ContentHeader import org.jetbrains.dokka.pages.ContentText import org.jetbrains.dokka.pages.MemberPageNode -import org.junit.jupiter.api.Test import utils.docs +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -54,4 +54,4 @@ class ContentForReceiverTest: BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/samples/ContentForSamplesTest.kt b/plugins/base/src/test/kotlin/content/samples/ContentForSamplesTest.kt index 9b5ab7ad..08a9a098 100644 --- a/plugins/base/src/test/kotlin/content/samples/ContentForSamplesTest.kt +++ b/plugins/base/src/test/kotlin/content/samples/ContentForSamplesTest.kt @@ -4,11 +4,12 @@ import matchers.content.* import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.base.transformers.pages.KOTLIN_PLAYGROUND_SCRIPT import org.jetbrains.dokka.model.DisplaySourceSet -import org.junit.jupiter.api.Test import utils.TestOutputWriterPlugin +import utils.assertContains import utils.classSignature import utils.findTestType import java.nio.file.Paths +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -79,7 +80,7 @@ class ContentForSamplesTest : BaseAbstractTest() { ) { pagesTransformationStage = { module -> val page = module.findTestType("test", "Foo") - assert(KOTLIN_PLAYGROUND_SCRIPT in page.embeddedResources) + assertContains(page.embeddedResources, KOTLIN_PLAYGROUND_SCRIPT) page.content.assertNode { group { header(1) { +"Foo" } @@ -143,7 +144,7 @@ class ContentForSamplesTest : BaseAbstractTest() { ) { pagesTransformationStage = { module -> val page = module.findTestType("pageMerger", "Parent") - assert(KOTLIN_PLAYGROUND_SCRIPT in page.embeddedResources) + assertContains(page.embeddedResources, KOTLIN_PLAYGROUND_SCRIPT) page.content.assertNode { group { header(1) { +"Parent" } @@ -199,4 +200,4 @@ class ContentForSamplesTest : BaseAbstractTest() { private fun Set<DisplaySourceSet>.assertSourceSet(expectedName: String) { assertEquals(1, this.size) assertEquals(expectedName, this.first().name) -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt index 82a04b89..7e4ed0cf 100644 --- a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt +++ b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt @@ -4,8 +4,8 @@ import matchers.content.* import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DisplaySourceSet import org.jetbrains.dokka.pages.ContentDRILink -import org.junit.jupiter.api.Test import utils.* +import kotlin.test.Test import kotlin.test.assertEquals class ContentForSeeAlsoTest : BaseAbstractTest() { @@ -857,4 +857,4 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { private fun Set<DisplaySourceSet>.assertSourceSet(expectedName: String) { assertEquals(1, this.size) assertEquals(expectedName, this.first().name) -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt index e57e6a8c..a1d8e260 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt @@ -4,7 +4,7 @@ import matchers.content.* import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.pages.BasicTabbedContentType import org.jetbrains.dokka.pages.ContentPage -import org.junit.jupiter.api.Test +import kotlin.test.Test import utils.OnlyDescriptors class ConstructorsSignaturesTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt index a39ade25..3c81d69b 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt @@ -5,11 +5,11 @@ import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.PackagePageNode -import org.junit.jupiter.api.Test import utils.ParamAttributes import utils.bareSignature import utils.propertySignature import utils.typealiasSignature +import kotlin.test.Test class ContentForSignaturesTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/typealiases/TypealiasTest.kt b/plugins/base/src/test/kotlin/content/typealiases/TypealiasTest.kt index c2f58cb9..4b2b003a 100644 --- a/plugins/base/src/test/kotlin/content/typealiases/TypealiasTest.kt +++ b/plugins/base/src/test/kotlin/content/typealiases/TypealiasTest.kt @@ -3,9 +3,10 @@ package content.typealiases import matchers.content.* import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.dfs -import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Test +import org.jetbrains.dokka.pages.ClasslikePageNode +import org.jetbrains.dokka.pages.PlatformHintedContent import utils.assertNotNull +import kotlin.test.Test class TypealiasTest : BaseAbstractTest() { @@ -75,4 +76,4 @@ class TypealiasTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt index 1602a7cf..f00591a2 100644 --- a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt @@ -2,10 +2,10 @@ package enums import org.jetbrains.dokka.SourceLinkDefinitionImpl import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.TestOutputWriterPlugin import java.net.URL +import kotlin.test.Test import kotlin.test.assertEquals class JavaEnumsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt index a49a29de..3bf1b3f1 100644 --- a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt +++ b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt @@ -10,12 +10,14 @@ import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentGroup import org.jsoup.Jsoup import org.jsoup.nodes.Element -import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.TestOutputWriter import utils.TestOutputWriterPlugin import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull +import kotlin.test.assertTrue class KotlinEnumsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt index 1d86f219..29905035 100644 --- a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt @@ -1,11 +1,12 @@ package expect import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions.assertTrue import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.util.concurrent.TimeUnit +import kotlin.test.assertEquals +import kotlin.test.assertTrue abstract class AbstractExpectTest( val testDir: Path? = Paths.get("src/test", "resources", "expect"), @@ -40,9 +41,9 @@ abstract class AbstractExpectTest( ).also { logger.info("git diff command: ${it.command().joinToString(" ")}") } .also { it.redirectErrorStream() }.start() - assertTrue(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS)) { "Git timed out after $gitTimeout" } + assertTrue(gitCompare.waitFor(gitTimeout, TimeUnit.MILLISECONDS), "Git timed out after $gitTimeout") gitCompare.inputStream.bufferedReader().lines().forEach { logger.info(it) } - assertTrue(gitCompare.exitValue() == 0) { "${path.fileName}: outputs don't match" } + assertEquals(0, gitCompare.exitValue(), "${path.fileName}: outputs don't match") } ?: throw AssertionError("obtained path is null") } @@ -54,7 +55,7 @@ abstract class AbstractExpectTest( ) { obtained?.let { _ -> val (res, out, err) = runDiff(expected, obtained, excludes, timeout) - assertTrue(res == 0, "Outputs differ:\nstdout - $out\n\nstderr - ${err ?: ""}") + assertEquals(0, res, "Outputs differ:\nstdout - $out\n\nstderr - ${err ?: ""}") } ?: throw AssertionError("obtained path is null") } diff --git a/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt b/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt index cb3313f9..4112cd28 100644 --- a/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt +++ b/plugins/base/src/test/kotlin/expect/ExpectGenerator.kt @@ -1,13 +1,13 @@ package expect -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test +import kotlin.test.Ignore +import kotlin.test.Test class ExpectGenerator : AbstractExpectTest() { - @Disabled + @Ignore @Test fun generateAll() = testDir?.dirsWithFormats(formats).orEmpty().forEach { (p, f) -> generateExpect(p, f) } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/expect/ExpectTest.kt b/plugins/base/src/test/kotlin/expect/ExpectTest.kt index bed841a6..ec9c8c6d 100644 --- a/plugins/base/src/test/kotlin/expect/ExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/ExpectTest.kt @@ -1,8 +1,8 @@ package expect -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.DynamicTest.dynamicTest import org.junit.jupiter.api.TestFactory +import kotlin.test.Ignore class ExpectTest : AbstractExpectTest() { private val ignores: List<String> = listOf( @@ -16,9 +16,9 @@ class ExpectTest : AbstractExpectTest() { "*.map" ) - @Disabled + @Ignore @TestFactory fun expectTest() = testDir?.dirsWithFormats(formats).orEmpty().map { (p, f) -> dynamicTest("${p.fileName}-$f") { testOutputWithExcludes(p, f, ignores) } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt b/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt index ff1b7989..6344aa5a 100644 --- a/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt +++ b/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt @@ -3,8 +3,9 @@ package expectActuals import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.ClasslikePageNode -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue class ExpectActualsTest : BaseAbstractTest() { @@ -146,25 +147,28 @@ class ExpectActualsTest : BaseAbstractTest() { val commonN1 = allChildren.filter { it.name == "[mingwX64, linuxX64]A" } val commonN2 = allChildren.filter { it.name == "[iosX64, iosArm64]A" } val noClass = allChildren.filter { it.name == "A" } - assertTrue(commonJ.size == 1) { "There can be only one [jvm, js]A page" } + assertEquals(1, commonJ.size, "There can be only one [jvm, js]A page") assertTrue( commonJ.first().documentables.firstOrNull()?.sourceSets?.map { it.displayName } - ?.containsAll(listOf("commonJ", "js", "jvm")) ?: false - ) { "A(jvm, js)should have commonJ, js, jvm sources" } + ?.containsAll(listOf("commonJ", "js", "jvm")) ?: false, + "A(jvm, js)should have commonJ, js, jvm sources" + ) - assertTrue(commonN1.size == 1) { "There can be only one [mingwX64, linuxX64]A page" } + assertEquals(1, commonN1.size, "There can be only one [mingwX64, linuxX64]A page") assertTrue( commonN1.first().documentables.firstOrNull()?.sourceSets?.map { it.displayName } - ?.containsAll(listOf("commonN1", "linuxX64", "mingwX64")) ?: false - ) { "[mingwX64, linuxX64]A should have commonN1, linuxX64, mingwX64 sources" } + ?.containsAll(listOf("commonN1", "linuxX64", "mingwX64")) ?: false, + "[mingwX64, linuxX64]A should have commonN1, linuxX64, mingwX64 sources" + ) - assertTrue(commonN2.size == 1) { "There can be only one [iosX64, iosArm64]A page" } + assertEquals(1, commonN2.size, "There can be only one [iosX64, iosArm64]A page") assertTrue( commonN2.first().documentables.firstOrNull()?.sourceSets?.map { it.displayName } - ?.containsAll(listOf("commonN2", "iosArm64", "iosX64")) ?: false - ) { "[iosX64, iosArm64]A should have commonN2, iosArm64, iosX64 sources" } + ?.containsAll(listOf("commonN2", "iosArm64", "iosX64")) ?: false, + "[iosX64, iosArm64]A should have commonN2, iosArm64, iosX64 sources" + ) - assertTrue(noClass.isEmpty()) { "There can't be any A page" } + assertTrue(noClass.isEmpty(), "There can't be any A page") } } } diff --git a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt index 44caecaa..c28f3fd0 100644 --- a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt @@ -3,8 +3,8 @@ package filter import org.jetbrains.dokka.DokkaDefaults import org.jetbrains.dokka.PackageOptionsImpl import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertTrue class DeprecationFilterTest : BaseAbstractTest() { @@ -41,7 +41,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.isEmpty() ) } @@ -72,7 +72,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } @@ -103,7 +103,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } @@ -134,7 +134,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.isEmpty() ) } @@ -169,7 +169,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().classlikes.first().classlikes.isEmpty() ) } @@ -210,7 +210,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.isEmpty() ) } @@ -250,7 +250,7 @@ class DeprecationFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } diff --git a/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt b/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt index 58a8e5f1..b4ee6c00 100644 --- a/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/EmptyPackagesFilterTest.kt @@ -1,9 +1,9 @@ package filter import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue class EmptyPackagesFilterTest : BaseAbstractTest() { @Test @@ -28,7 +28,7 @@ class EmptyPackagesFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.isNotEmpty() ) } diff --git a/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt b/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt index a1a242c5..5d507669 100644 --- a/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt @@ -1,8 +1,8 @@ package filter import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertTrue class JavaFileFilterTest : BaseAbstractTest() { @Test @@ -27,7 +27,7 @@ class JavaFileFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.isNotEmpty() ) } diff --git a/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt b/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt index 6423655a..8130766d 100644 --- a/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt @@ -7,10 +7,10 @@ import org.jetbrains.dokka.PackageOptionsImpl import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DModule -import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.MethodSource import testApi.testRunner.dokkaConfiguration +import kotlin.test.Test import utils.JavaCode import kotlin.test.assertEquals @@ -302,4 +302,5 @@ class JavaVisibilityFilterTest : BaseAbstractTest() { ConfigurationWithVisibility("public", configuration, expectedClasslikes = 1) } } -}
\ No newline at end of file +} + diff --git a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt index af77d61c..19dd6204 100644 --- a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt +++ b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt @@ -6,8 +6,9 @@ import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.FunctionalTypeConstructor import org.jetbrains.dokka.model.GenericTypeConstructor import org.jetbrains.dokka.model.Invariance -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotEquals import utils.OnlyDescriptors class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { @@ -42,9 +43,9 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { val typeArrayNames = listOf("IntArray", "BooleanArray", "FloatArray", "DoubleArray", "LongArray", "ShortArray", "CharArray", "ByteArray") - Assertions.assertEquals(typeArrayNames.size, params?.size) + assertEquals(typeArrayNames.size, params?.size) params?.forEachIndexed{ i, param -> - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", typeArrayNames[i]), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin", typeArrayNames[i]), emptyList()), param.type) } } @@ -66,13 +67,13 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { ) { preMergeDocumentablesTransformationStage = { val params = it.firstOrNull()?.packages?.firstOrNull()?.functions?.firstOrNull()?.parameters - Assertions.assertEquals( + assertEquals( Invariance(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList())), (params?.firstOrNull()?.type as? GenericTypeConstructor)?.projections?.firstOrNull()) - Assertions.assertEquals( + assertEquals( Invariance(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList())), (params?.get(1)?.type as? FunctionalTypeConstructor)?.projections?.get(0)) - Assertions.assertEquals( + assertEquals( Invariance(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList())), (params?.get(1)?.type as? FunctionalTypeConstructor)?.projections?.get(1)) } @@ -101,11 +102,11 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { val myTestClass = it.firstOrNull()?.packages?.firstOrNull()?.classlikes?.firstOrNull() val property = myTestClass?.properties?.firstOrNull() - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), property?.type) - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), property?.getter?.type) - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin", "BooleanArray"), emptyList()), property?.setter?.parameters?.firstOrNull()?.type) } } @@ -126,7 +127,7 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { preMergeDocumentablesTransformationStage = { val arrTypealias = it.firstOrNull()?.packages?.firstOrNull()?.typealiases?.firstOrNull() - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList()), arrTypealias?.underlyingType?.values?.firstOrNull()) } } @@ -151,9 +152,9 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { val testFun = it.firstOrNull()?.packages?.firstOrNull()?.functions?.firstOrNull() val myTestClass = it.firstOrNull()?.packages?.firstOrNull()?.classlikes?.firstOrNull() as? DClass - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin","IntArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin","IntArray"), emptyList()), testFun?.generics?.firstOrNull()?.bounds?.firstOrNull()) - Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin","IntArray"), emptyList()), + assertEquals(GenericTypeConstructor(DRI("kotlin","IntArray"), emptyList()), myTestClass?.generics?.firstOrNull()?.bounds?.firstOrNull()) } } @@ -192,12 +193,12 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { ) { preMergeDocumentablesTransformationStage = { val paramsJS = it[1].packages.firstOrNull()?.functions?.firstOrNull()?.parameters - Assertions.assertNotEquals( + assertNotEquals( GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList()), paramsJS?.firstOrNull()?.type) val paramsJVM = it.firstOrNull()?.packages?.firstOrNull()?.functions?.firstOrNull()?.parameters - Assertions.assertEquals( + assertEquals( GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList()), paramsJVM?.firstOrNull()?.type) } diff --git a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt index e1bd94ba..93a05bfd 100644 --- a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt @@ -7,11 +7,7 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.DModule -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test -import kotlin.test.assertEquals -import kotlin.test.assertFalse -import kotlin.test.assertTrue +import kotlin.test.* class VisibilityFilterTest : BaseAbstractTest() { @@ -364,7 +360,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertNull( + assertNull( it.first().packages.first().properties.first().setter ) } @@ -429,7 +425,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } @@ -461,7 +457,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.isEmpty() ) } @@ -493,7 +489,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } @@ -525,7 +521,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertNull( + assertNull( it.first().packages.first().properties.first().setter ) } @@ -567,7 +563,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.size == 1 ) } @@ -609,7 +605,7 @@ class VisibilityFilterTest : BaseAbstractTest() { configuration ) { preMergeDocumentablesTransformationStage = { - Assertions.assertTrue( + assertTrue( it.first().packages.first().functions.isEmpty() ) } diff --git a/plugins/base/src/test/kotlin/issues/IssuesTest.kt b/plugins/base/src/test/kotlin/issues/IssuesTest.kt index 67aa3a1e..b57ab7ba 100644 --- a/plugins/base/src/test/kotlin/issues/IssuesTest.kt +++ b/plugins/base/src/test/kotlin/issues/IssuesTest.kt @@ -2,9 +2,9 @@ package issues import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DFunction -import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.name +import kotlin.test.Test class IssuesTest : AbstractModelTest("/src/main/kotlin/issues/Test.kt", "issues") { diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt index ccf62641..6e11929d 100644 --- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt +++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt @@ -8,15 +8,16 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.pages.* import org.jsoup.Jsoup -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test -import utils.OnlyDescriptors -import utils.OnlyDescriptorsMPP import utils.TestOutputWriterPlugin import utils.assertNotNull import java.net.URL import java.nio.file.Paths +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertNotEquals +import kotlin.test.assertNotNull +import utils.OnlyDescriptors +import utils.OnlyDescriptorsMPP class LinkableContentTest : BaseAbstractTest() { @@ -64,10 +65,10 @@ class LinkableContentTest : BaseAbstractTest() { testFromData(configuration) { documentablesMergingStage = { - Assertions.assertEquals(2, it.documentation.size) - Assertions.assertEquals(2, it.packages.size) - Assertions.assertEquals(1, it.packages.first().documentation.size) - Assertions.assertEquals(1, it.packages.last().documentation.size) + assertEquals(2, it.documentation.size) + assertEquals(2, it.packages.size) + assertEquals(1, it.packages.first().documentation.size) + assertEquals(1, it.packages.last().documentation.size) } } @@ -130,14 +131,14 @@ class LinkableContentTest : BaseAbstractTest() { renderingStage = { rootPageNode, dokkaContext -> val newRoot = SourceLinksTransformer(dokkaContext).invoke(rootPageNode) val moduleChildren = newRoot.children - Assertions.assertEquals(1, moduleChildren.size) + assertEquals(1, moduleChildren.size) val packageChildren = moduleChildren.first().children - Assertions.assertEquals(2, packageChildren.size) + assertEquals(2, packageChildren.size) packageChildren.forEach { val name = it.name.substringBefore("Class") val signature = (it as? ClasslikePageNode)?.content?.dfs { it is ContentGroup && it.dci.kind == ContentKind.Symbol }.assertNotNull("signature") val crl = signature.children.last().children[1] as? ContentResolvedLink - Assertions.assertEquals( + assertEquals( "https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3", crl?.address ) @@ -193,13 +194,13 @@ class LinkableContentTest : BaseAbstractTest() { // val newRoot = DefaultSamplesTransformer(dokkaContext).invoke(rootPageNode) val newRoot = rootPageNode val moduleChildren = newRoot.children - Assertions.assertEquals(1, moduleChildren.size) + assertEquals(1, moduleChildren.size) val packageChildren = moduleChildren.first().children - Assertions.assertEquals(2, packageChildren.size) + assertEquals(2, packageChildren.size) packageChildren.forEach { pageNode -> val name = pageNode.name.substringBefore("Class") val classChildren = pageNode.children - Assertions.assertEquals(2, classChildren.size) + assertEquals(2, classChildren.size) val function = classChildren.find { it.name == "printWithExclamation" } val text = (function as MemberPageNode).content.let { it as ContentGroup }.children.last() .let { it as ContentDivergentGroup }.children.single().after @@ -207,7 +208,7 @@ class LinkableContentTest : BaseAbstractTest() { .let { it as ContentGroup }.children.single() .let { it as ContentCodeBlock }.children.single() .let { it as ContentText }.text - Assertions.assertEquals( + assertEquals( """|import p2.${name}Class |fun main() { | //sampleStart @@ -262,7 +263,7 @@ class LinkableContentTest : BaseAbstractTest() { child?.text == "S" } as? ContentDRILink - Assertions.assertEquals( + assertEquals( (sample.documentables.firstOrNull() as WithGenerics).generics.first().dri, returnTypeNode?.address ) @@ -300,7 +301,7 @@ class LinkableContentTest : BaseAbstractTest() { testFromData(configuration) { documentablesMergingStage = { - Assertions.assertNotEquals(null, it.packages.first().documentation.values.single().dfs { + assertNotEquals(null, it.packages.first().documentation.values.single().dfs { (it as? Text)?.body?.contains("@SqlTable") ?: false }) } @@ -354,20 +355,18 @@ class LinkableContentTest : BaseAbstractTest() { testFromData(configuration) { documentablesMergingStage = { module -> - module.documentation.entries.single { + val value = module.documentation.entries.single { it.key.displayName == "jvm" - }.value.run { - Assertions.assertNotNull(dfs { - (it as? Text)?.body == "This is second JVM documentation for module example" - }) + }.value + assertNotNull(value.dfs { + (it as? Text)?.body == "This is second JVM documentation for module example" + }) - Assertions.assertNotNull(dfs { - (it as? Text)?.body == "This is JVM documentation for module example" - }) - } + assertNotNull(value.dfs { + (it as? Text)?.body == "This is JVM documentation for module example" + }) } } - } @Test diff --git a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt index 9ba428d6..a8604e2c 100644 --- a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt +++ b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt @@ -8,12 +8,12 @@ import org.jetbrains.dokka.model.doc.DocumentationLink import org.jetbrains.dokka.pages.ContentDRILink import org.jetbrains.dokka.pages.ContentPage import org.jsoup.Jsoup -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertNotNull -import org.junit.jupiter.api.Test -import utils.OnlyDescriptors import utils.TestOutputWriterPlugin import java.nio.file.Paths +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull +import utils.OnlyDescriptors class EnumValuesLinkingTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt index e9e0871a..a550f852 100644 --- a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt @@ -10,9 +10,9 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.TypeConstructor import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals class AndroidExternalLocationProviderTest : BaseAbstractTest() { private val android = ExternalDocumentation( diff --git a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt index 870d8cf3..c4c5ff64 100644 --- a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt @@ -8,9 +8,9 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.TypeConstructor import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals class DefaultExternalLocationProviderTest : BaseAbstractTest() { private val testDataDir = diff --git a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt index 241e0919..557cf66e 100644 --- a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt @@ -8,9 +8,9 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.TypeConstructor import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals class Dokka010ExternalLocationProviderTest : BaseAbstractTest() { private val testDataDir = diff --git a/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt index f43a4cd7..180c5238 100644 --- a/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt @@ -5,8 +5,8 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals class DokkaLocationProviderTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt index 27e51caf..b0b466c5 100644 --- a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt @@ -10,9 +10,9 @@ import org.jetbrains.dokka.links.DRIExtraContainer import org.jetbrains.dokka.links.EnumEntryDRIExtra import org.jetbrains.dokka.links.PointingToDeclaration import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals class JavadocExternalLocationProviderTest : BaseAbstractTest() { private val testDataDir = diff --git a/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt b/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt index 031dd101..a4b2487a 100644 --- a/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt +++ b/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt @@ -6,9 +6,9 @@ import org.jetbrains.dokka.base.resolvers.shared.PackageList import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.plugability.DokkaContext -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import java.net.URL +import kotlin.test.Test +import kotlin.test.assertEquals class MultiModuleLinkingTest : BaseAbstractTest() { private val testDataDir = diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index 69885931..774f07a6 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -4,7 +4,7 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DPackage import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.pages.ModulePageNode -import org.junit.jupiter.api.Assertions.assertEquals +import kotlin.test.assertEquals abstract class KDocTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/markdown/LinkTest.kt b/plugins/base/src/test/kotlin/markdown/LinkTest.kt index 8ee5a20d..5cae4c42 100644 --- a/plugins/base/src/test/kotlin/markdown/LinkTest.kt +++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt @@ -8,9 +8,9 @@ import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentDRILink import org.jetbrains.dokka.pages.MemberPageNode -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertNotNull -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull import utils.UsingJDK class LinkTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt index e10a2260..49cbffd7 100644 --- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt +++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt @@ -5,9 +5,10 @@ import markdown.KDocTest import org.jetbrains.dokka.analysis.markdown.jb.MARKDOWN_ELEMENT_FILE_NAME import org.jetbrains.dokka.analysis.markdown.jb.MarkdownParser import org.jetbrains.dokka.model.doc.* -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test +import kotlin.test.Ignore +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue class ParserTest : KDocTest() { @@ -677,7 +678,7 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Disabled //TODO: ATX_2 to ATX_6 and sometimes ATX_1 from jetbrains parser consumes white space. Need to handle it in their library + @Ignore //TODO: ATX_2 to ATX_6 and sometimes ATX_1 from jetbrains parser consumes white space. Need to handle it in their library @Test fun `All headers`() { val kdoc = """ @@ -863,7 +864,7 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } - @Disabled //TODO: Again ATX_1 consumes white space + @Ignore //TODO: Again ATX_1 consumes white space @Test fun `Blockquote nested with fancy text enhancement`() { val kdoc = """ @@ -1483,7 +1484,7 @@ class ParserTest : KDocTest() { val exception = runCatching { executeTest(kdoc, expectedDocumentationNode) }.exceptionOrNull() val expectedMessage = "Wrong AST Tree. Header does not contain expected content in Test.kt/example.Test, element starts from offset 0 and ends 3: ###" - assert( + assertTrue( exception?.message == expectedMessage || /* for K2 */ exception?.cause?.cause?.message == expectedMessage ) diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index e358945e..cf11c62f 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -5,8 +5,8 @@ import org.jetbrains.dokka.links.TypeConstructor import org.jetbrains.dokka.links.sureClassNames import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.KotlinModifier.* -import org.junit.jupiter.api.Assertions.assertNull -import org.junit.jupiter.api.Test +import kotlin.test.assertNull +import kotlin.test.Test import utils.* diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt index cd149209..1131e8dd 100644 --- a/plugins/base/src/test/kotlin/model/CommentTest.kt +++ b/plugins/base/src/test/kotlin/model/CommentTest.kt @@ -3,11 +3,11 @@ package model import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DProperty import org.jetbrains.dokka.model.doc.* -import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull import utils.comments import utils.docs +import kotlin.test.Test class CommentTest : AbstractModelTest("/src/main/kotlin/comment/Test.kt", "comment") { diff --git a/plugins/base/src/test/kotlin/model/ExtensionsTest.kt b/plugins/base/src/test/kotlin/model/ExtensionsTest.kt index b54f8deb..f0f86d7f 100644 --- a/plugins/base/src/test/kotlin/model/ExtensionsTest.kt +++ b/plugins/base/src/test/kotlin/model/ExtensionsTest.kt @@ -6,8 +6,8 @@ import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.DInterface import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test import utils.UsingJDK class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "classes") { @@ -87,7 +87,7 @@ class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "cl } } } - + @Test fun `should be extension for typealias`() { inlineModelTest( diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index 3410f9ef..d1c34c29 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -2,8 +2,12 @@ package model import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* -import org.junit.jupiter.api.Test -import utils.* +import utils.AbstractModelTest +import utils.assertNotNull +import utils.comments +import utils.OnlyDescriptors +import utils.name +import kotlin.test.Test class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "function") { diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index 641f6ef5..8ebb65c2 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -7,10 +7,10 @@ import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.DInterface import org.jetbrains.dokka.model.doc.P import org.jetbrains.dokka.model.doc.Text -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull +import kotlin.test.Test +import kotlin.test.assertTrue class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", "inheritors") { diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index a0605a5e..f8e45ca2 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -7,11 +7,14 @@ import org.jetbrains.dokka.links.* import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.Param import org.jetbrains.dokka.model.doc.Text -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test -import utils.* +import utils.AbstractModelTest import utils.assertContains +import utils.assertNotNull +import utils.name +import utils.JavaCode +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue @JavaCode class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { @@ -464,17 +467,17 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { when (function.name) { "superBound" -> { assertTrue(variance is Contravariance<*>) - val bound = (variance as Contravariance<*>).inner + val bound = variance.inner assertEquals((bound as GenericTypeConstructor).dri.classNames, "String") } "extendsBound" -> { assertTrue(variance is Covariance<*>) - val bound = (variance as Covariance<*>).inner + val bound = variance.inner assertEquals((bound as GenericTypeConstructor).dri.classNames, "String") } "unbounded" -> { assertTrue(variance is Covariance<*>) - val bound = (variance as Covariance<*>).inner + val bound = variance.inner assertTrue(bound is JavaObject) } } diff --git a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt index 6f08c89d..7b807b3a 100644 --- a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt +++ b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt @@ -7,10 +7,10 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.utilities.firstIsInstanceOrNull -import org.junit.jupiter.api.Test import translators.documentationOf import utils.JavaCode import utils.docs +import kotlin.test.Test import kotlin.test.assertEquals @JavaCode diff --git a/plugins/base/src/test/kotlin/model/ObjectTest.kt b/plugins/base/src/test/kotlin/model/ObjectTest.kt index 86045110..2f307adb 100644 --- a/plugins/base/src/test/kotlin/model/ObjectTest.kt +++ b/plugins/base/src/test/kotlin/model/ObjectTest.kt @@ -3,8 +3,8 @@ package model import org.jetbrains.dokka.model.AdditionalModifiers import org.jetbrains.dokka.model.DObject import org.jetbrains.dokka.model.ExtraModifiers -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test class ObjectTest : AbstractModelTest("/src/main/kotlin/objects/Test.kt", "objects") { diff --git a/plugins/base/src/test/kotlin/model/PackagesTest.kt b/plugins/base/src/test/kotlin/model/PackagesTest.kt index b9e7051d..33675356 100644 --- a/plugins/base/src/test/kotlin/model/PackagesTest.kt +++ b/plugins/base/src/test/kotlin/model/PackagesTest.kt @@ -1,8 +1,8 @@ package model import org.jetbrains.dokka.model.DPackage -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "packages") { diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index d38667bf..8b15bc68 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -1,10 +1,10 @@ package model import org.jetbrains.dokka.model.* -import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull import utils.name +import kotlin.test.Test class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "property") { diff --git a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt index 35997681..aa375423 100644 --- a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt +++ b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt @@ -4,8 +4,8 @@ import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.annotations import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.utilities.cast -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test import utils.JavaCode import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -175,4 +175,5 @@ class JavaAnnotationsForParametersTest : AbstractModelTest("/src/main/kotlin/jav } } } -}
\ No newline at end of file +} + diff --git a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt index 0abf504e..ad5241ae 100644 --- a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt @@ -2,13 +2,9 @@ package model.annotations import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.* -import org.junit.jupiter.api.Test import translators.findClasslike +import kotlin.test.* import utils.JavaCode -import kotlin.test.assertEquals -import kotlin.test.assertFalse -import kotlin.test.assertNotNull -import kotlin.test.assertTrue @JavaCode class JavaAnnotationsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/model/annotations/KotlinAnnotationsForParametersTest.kt b/plugins/base/src/test/kotlin/model/annotations/KotlinAnnotationsForParametersTest.kt index c459cc34..7a7591fb 100644 --- a/plugins/base/src/test/kotlin/model/annotations/KotlinAnnotationsForParametersTest.kt +++ b/plugins/base/src/test/kotlin/model/annotations/KotlinAnnotationsForParametersTest.kt @@ -4,8 +4,8 @@ import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.annotations import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.utilities.cast -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -98,4 +98,4 @@ class KotlinAnnotationsForParametersTest : AbstractModelTest("/src/main/kotlin/a } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt index 1e4869f8..b7a00dcd 100644 --- a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt +++ b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt @@ -1,8 +1,8 @@ package multiplatform import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals class BasicMultiplatformTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/packageList/PackageListTest.kt b/plugins/base/src/test/kotlin/packageList/PackageListTest.kt index 310a23c6..48d360d5 100644 --- a/plugins/base/src/test/kotlin/packageList/PackageListTest.kt +++ b/plugins/base/src/test/kotlin/packageList/PackageListTest.kt @@ -2,8 +2,8 @@ package packageList import org.jetbrains.dokka.base.renderers.PackageListService import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals class PackageListTest { @Test diff --git a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt index 13431bd2..e386f95c 100644 --- a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt +++ b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt @@ -4,11 +4,11 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.RepeatedTest -import org.junit.jupiter.api.Test +import kotlin.test.Ignore +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue class PageNodeMergerTest : BaseAbstractTest() { @@ -42,16 +42,16 @@ class PageNodeMergerTest : BaseAbstractTest() { val testT = allChildren.filter { it.name == "testT" } val test = allChildren.filter { it.name == "test" } - assertTrue(testT.size == 1) { "There can be only one testT page" } - assertTrue(testT.first().dri.size == 2) { "testT page should have 2 DRI, but has ${testT.first().dri.size}" } + assertTrue(testT.size == 1, "There can be only one testT page") + assertTrue(testT.first().dri.size == 2, "testT page should have 2 DRI, but has ${testT.first().dri.size}") - assertTrue(test.size == 1) { "There can be only one test page" } - assertTrue(test.first().dri.size == 2) { "test page should have 2 DRI, but has ${test.first().dri.size}" } + assertTrue(test.size == 1, "There can be only one test page") + assertTrue(test.first().dri.size == 2, "test page should have 2 DRI, but has ${test.first().dri.size}") } } } - @Disabled("TODO: reenable when we have infrastructure for turning off extensions") + @Ignore("TODO: reenable when we have infrastructure for turning off extensions") @Test fun defaultStrategyTest() { val strList: MutableList<String> = mutableListOf() @@ -76,13 +76,13 @@ class PageNodeMergerTest : BaseAbstractTest() { val testT = allChildren.filter { it.name == "testT" } val test = allChildren.filter { it.name == "test" } - assertTrue(testT.size == 1) { "There can be only one testT page" } - assertTrue(testT.first().dri.size == 1) { "testT page should have single DRI, but has ${testT.first().dri.size}" } + assertTrue(testT.size == 1, "There can be only one testT page") + assertTrue(testT.first().dri.size == 1, "testT page should have single DRI, but has ${testT.first().dri.size}") - assertTrue(test.size == 1) { "There can be only one test page" } - assertTrue(test.first().dri.size == 1) { "test page should have single DRI, but has ${test.first().dri.size}" } + assertTrue(test.size == 1, "There can be only one test page") + assertTrue(test.first().dri.size == 1, "test page should have single DRI, but has ${test.first().dri.size}") - assertTrue(strList.count() == 2) { "Expected 2 warnings, got ${strList.count()}" } + assertTrue(strList.count() == 2, "Expected 2 warnings, got ${strList.count()}") } } } @@ -142,13 +142,19 @@ class PageNodeMergerTest : BaseAbstractTest() { val jvmClass = allChildren.filter { it.name == "[jvm]DoNotMerge" } val jsClass = allChildren.filter { it.name == "[js]DoNotMerge" } val noClass = allChildren.filter { it.name == "DoNotMerge" } - assertTrue(jvmClass.size == 1) { "There can be only one DoNotMerge(jvm) page" } - assertTrue(jvmClass.first().documentables.firstOrNull()?.sourceSets?.single()?.analysisPlatform?.key == "jvm") { "[jvm]DoNotMerge should have only jvm sources" } + assertTrue(jvmClass.size == 1, "There can be only one DoNotMerge(jvm) page") + assertTrue( + jvmClass.first().documentables.firstOrNull()?.sourceSets?.single()?.analysisPlatform?.key == "jvm", + "[jvm]DoNotMerge should have only jvm sources" + ) - assertTrue(jsClass.size == 1) { "There can be only one DoNotMerge(js) page" } - assertTrue(jsClass.first().documentables.firstOrNull()?.sourceSets?.single()?.analysisPlatform?.key == "js") { "[js]DoNotMerge should have only js sources" } + assertTrue(jsClass.size == 1, "There can be only one DoNotMerge(js) page") + assertTrue( + jsClass.first().documentables.firstOrNull()?.sourceSets?.single()?.analysisPlatform?.key == "js", + "[js]DoNotMerge should have only js sources" + ) - assertTrue(noClass.isEmpty()) { "There can't be any DoNotMerge page" } + assertTrue(noClass.isEmpty(), "There can't be any DoNotMerge page") } } } diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt index 4b376c73..a3f1710c 100644 --- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt +++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt @@ -8,12 +8,12 @@ import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.utilities.firstIsInstanceOrNull -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import utils.JavaCode import utils.docs import utils.text +import kotlin.test.Test +import kotlin.test.assertEquals import kotlin.test.assertNotNull +import utils.JavaCode @JavaCode class JavadocParserTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/renderers/html/BasicTest.kt b/plugins/base/src/test/kotlin/renderers/html/BasicTest.kt index fbcdf70e..8817ea27 100644 --- a/plugins/base/src/test/kotlin/renderers/html/BasicTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/BasicTest.kt @@ -2,10 +2,10 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.links.DRI -import org.junit.jupiter.api.Test import renderers.testPage import utils.Span import utils.match +import kotlin.test.Test class BasicTest : HtmlRenderingOnlyTestBase() { @Test diff --git a/plugins/base/src/test/kotlin/renderers/html/BreadcrumbsTest.kt b/plugins/base/src/test/kotlin/renderers/html/BreadcrumbsTest.kt index bebc41dc..1acafacc 100644 --- a/plugins/base/src/test/kotlin/renderers/html/BreadcrumbsTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/BreadcrumbsTest.kt @@ -2,9 +2,9 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.* +import kotlin.test.Test class BreadcrumbsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/renderers/html/CoverPageTest.kt b/plugins/base/src/test/kotlin/renderers/html/CoverPageTest.kt index 522f9037..ef41a00a 100644 --- a/plugins/base/src/test/kotlin/renderers/html/CoverPageTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/CoverPageTest.kt @@ -1,9 +1,9 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.TestOutputWriterPlugin +import kotlin.test.Test import kotlin.test.assertEquals class CoverPageTest : BaseAbstractTest() { @@ -44,4 +44,4 @@ class CoverPageTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/CustomFooterTest.kt b/plugins/base/src/test/kotlin/renderers/html/CustomFooterTest.kt index c1ef6121..0b53d1c2 100644 --- a/plugins/base/src/test/kotlin/renderers/html/CustomFooterTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/CustomFooterTest.kt @@ -9,12 +9,12 @@ import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.base.templating.toJsonString import org.jsoup.Jsoup import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import renderers.testPage import utils.A import utils.Div import utils.Span import utils.match +import kotlin.test.Test class CustomFooterTest : HtmlRenderingOnlyTestBase() { @Test @@ -41,4 +41,4 @@ class CustomFooterTest : HtmlRenderingOnlyTestBase() { override val renderedContent: Element get() = files.contents.getValue("test-page.html").let { Jsoup.parse(it) }.select(".footer").single() -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt index f9dd92da..1542c6c2 100644 --- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt @@ -3,10 +3,10 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup -import org.junit.jupiter.api.Test import renderers.testPage import utils.Br import utils.match +import kotlin.test.Test import kotlin.test.assertEquals class DivergentTest : HtmlRenderingOnlyTestBase() { diff --git a/plugins/base/src/test/kotlin/renderers/html/FooterMessageTest.kt b/plugins/base/src/test/kotlin/renderers/html/FooterMessageTest.kt index d91c402e..82584121 100644 --- a/plugins/base/src/test/kotlin/renderers/html/FooterMessageTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/FooterMessageTest.kt @@ -4,11 +4,11 @@ import org.jetbrains.dokka.base.DokkaBaseConfiguration.Companion.defaultFooterMe import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jsoup.Jsoup import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import renderers.testPage import utils.A import utils.Span import utils.match +import kotlin.test.Test class FooterMessageTest : HtmlRenderingOnlyTestBase() { @Test @@ -24,4 +24,4 @@ class FooterMessageTest : HtmlRenderingOnlyTestBase() { override val renderedContent: Element get() = files.contents.getValue("test-page.html").let { Jsoup.parse(it) }.select(".footer").single() -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt b/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt index 3e5ceb75..9957d3f2 100644 --- a/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/FormattingUtilsTest.kt @@ -4,7 +4,7 @@ import kotlinx.html.body import kotlinx.html.html import kotlinx.html.stream.createHTML import org.jetbrains.dokka.base.renderers.html.buildBreakableText -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals class FormattingUtilsTest { @@ -79,4 +79,4 @@ class FormattingUtilsTest { assertEquals(expectedHtml.trim(), html.trim()) } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt index f69cf80f..e1faa460 100644 --- a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt @@ -2,11 +2,11 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle -import org.junit.jupiter.api.Test import renderers.testPage import utils.Div import utils.P import utils.match +import kotlin.test.Test class GroupWrappingTest : HtmlRenderingOnlyTestBase() { diff --git a/plugins/base/src/test/kotlin/renderers/html/ListStylesTest.kt b/plugins/base/src/test/kotlin/renderers/html/ListStylesTest.kt index 8b11dad1..ba063844 100644 --- a/plugins/base/src/test/kotlin/renderers/html/ListStylesTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/ListStylesTest.kt @@ -2,12 +2,12 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.ListStyle -import org.junit.jupiter.api.Test import renderers.testPage import utils.Dd import utils.Dl import utils.Dt import utils.match +import kotlin.test.Test class ListStylesTest : HtmlRenderingOnlyTestBase() { diff --git a/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt b/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt index fb2c53cd..cbdc28d8 100644 --- a/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt @@ -1,11 +1,11 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import utils.TestOutputWriterPlugin import utils.UsingJDK import utils.navigationHtml import utils.selectNavigationGrid +import kotlin.test.Test import kotlin.test.assertEquals class NavigationIconTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt b/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt index 75993e49..7f199ddd 100644 --- a/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt @@ -3,10 +3,11 @@ package renderers.html import org.jetbrains.dokka.base.renderers.html.NavigationNodeIcon import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import utils.TestOutputWriterPlugin import utils.navigationHtml +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertNotNull import kotlin.test.assertNull class NavigationTest : BaseAbstractTest() { @@ -389,7 +390,7 @@ class NavigationTest : BaseAbstractTest() { assertEquals(id, this.id()) val link = this.selectFirst("a") - checkNotNull(link) + assertNotNull(link) assertEquals(text, link.text()) assertEquals(address, link.attr("href")) if (icon != null) { diff --git a/plugins/base/src/test/kotlin/renderers/html/SearchbarDataInstallerTest.kt b/plugins/base/src/test/kotlin/renderers/html/SearchbarDataInstallerTest.kt index 33f86e9f..c19ad55b 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SearchbarDataInstallerTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SearchbarDataInstallerTest.kt @@ -1,10 +1,10 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.Test -import org.junit.jupiter.api.Assertions import utils.TestOutputWriterPlugin import utils.pagesJson +import kotlin.test.Test +import kotlin.test.assertEquals class SearchbarDataInstallerTest: BaseAbstractTest() { @@ -36,11 +36,11 @@ class SearchbarDataInstallerTest: BaseAbstractTest() { renderingStage = { _, _ -> val searchRecords = writerPlugin.writer.pagesJson() - Assertions.assertEquals( + assertEquals( "Test", searchRecords.find { record -> record.name == "class Test" }?.description ?: "" ) } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt index 633a59a7..47874a4c 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt @@ -3,12 +3,12 @@ package renderers.html import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle -import org.junit.jupiter.api.Test import renderers.testPage import testApi.testRunner.defaultSourceSet import utils.Div import utils.match import java.io.File +import kotlin.test.Test class SourceSetDependentHintTest : HtmlRenderingOnlyTestBase() { diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt index e6155535..75ee7f4b 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetFilterTest.kt @@ -1,10 +1,10 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.TestOutputWriterPlugin +import kotlin.test.Test +import kotlin.test.assertEquals class SourceSetFilterTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt b/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt index 7c42c22b..a2e2617a 100644 --- a/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/TabbedContentTest.kt @@ -2,9 +2,9 @@ package renderers.html import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.TestOutputWriterPlugin +import kotlin.test.Test import kotlin.test.assertEquals class TabbedContentTest : BaseAbstractTest() { @@ -178,4 +178,4 @@ class TabbedContentTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt b/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt index 507f1779..07415efe 100644 --- a/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/TextStylesTest.kt @@ -5,9 +5,9 @@ import org.jetbrains.dokka.pages.TextStyle import org.jetbrains.dokka.pages.TokenStyle import org.jsoup.Jsoup import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import renderers.testPage import utils.* +import kotlin.test.Test import kotlin.test.assertEquals class TextStylesTest : HtmlRenderingOnlyTestBase() { diff --git a/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt b/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt index 0bbd35d1..bbaad338 100644 --- a/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt +++ b/plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt @@ -14,12 +14,12 @@ import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement import org.jetbrains.dokka.transformers.pages.PageTransformer import org.jsoup.Jsoup import org.jsoup.nodes.TextNode -import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource import utils.TestOutputWriterPlugin import utils.assertContains import java.io.File +import kotlin.test.Test import kotlin.test.assertNotNull import kotlin.test.assertNull import kotlin.test.assertTrue @@ -79,10 +79,10 @@ class ResourceLinksTest : BaseAbstractTest() { .select("link, script") .let { absoluteResources.forEach { r -> - assert(it.`is`("[href=$r], [src=$r]")) + assertTrue(it.`is`("[href=$r], [src=$r]")) } relativeResources.forEach { r -> - assert(it.`is`("[href=../$r] , [src=../$r]")) + assertTrue(it.`is`("[href=../$r] , [src=../$r]")) } } } @@ -139,7 +139,7 @@ class ResourceLinksTest : BaseAbstractTest() { .select("link, script") .let { listOf("styles/customStyle.css").forEach { r -> - assert(it.`is`("[href=$TEMPLATE_REPLACEMENT$r]")) + assertTrue(it.`is`("[href=$TEMPLATE_REPLACEMENT$r]")) } } } else { @@ -149,7 +149,7 @@ class ResourceLinksTest : BaseAbstractTest() { .select("link, script") .let { listOf("styles/customStyle.css").forEach { r -> - assert(it.`is`("[href=../$r], [src=../$r]")) + assertTrue(it.`is`("[href=../$r], [src=../$r]")) } } } @@ -198,10 +198,10 @@ class ResourceLinksTest : BaseAbstractTest() { .select("link, script") .let { absoluteResources.forEach { r -> - assert(it.`is`("[href=$r], [src=$r]")) + assertTrue(it.`is`("[href=$r], [src=$r]")) } relativeResources.forEach { r -> - assert(it.`is`("[href=../$r] , [src=../$r]")) + assertTrue(it.`is`("[href=../$r] , [src=../$r]")) } } } diff --git a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt index af10cbee..e276ee5c 100644 --- a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt @@ -1,9 +1,10 @@ package signatures -import org.junit.jupiter.api.Test +import utils.TestOutputWriterPlugin +import kotlin.test.Test +import kotlin.test.assertEquals import utils.OnlyDescriptors import utils.OnlyDescriptorsMPP -import utils.TestOutputWriterPlugin @OnlyDescriptorsMPP class DivergentSignatureTest : AbstractRenderingTest() { @@ -20,10 +21,10 @@ class DivergentSignatureTest : AbstractRenderingTest() { renderingStage = { _, _ -> val content = writerPlugin.renderedSourceDependentContent("example/example/-clock/get-time.html") - assert(content.count() == 3) + assertEquals(3, content.count()) val sourceSets = listOf("example/common", "example/js", "example/jvm") sourceSets.forEach { - assert(content.select("[data-togglable=$it]").single().brief == "") + assertEquals("", content.select("[data-togglable=$it]").single().brief) } } } @@ -41,10 +42,10 @@ class DivergentSignatureTest : AbstractRenderingTest() { renderingStage = { _, _ -> val content = writerPlugin.renderedSourceDependentContent("example/example/-clock/get-times-in-millis.html") - assert(content.count() == 3) - assert(content.select("[data-togglable=example/common]").single().brief == "Time in minis") - assert(content.select("[data-togglable=example/jvm]").single().brief == "Time in minis") - assert(content.select("[data-togglable=example/js]").single().brief == "JS implementation of getTimeInMillis" ) + assertEquals(3, content.count()) + assertEquals("Time in minis", content.select("[data-togglable=example/common]").single().brief) + assertEquals("Time in minis", content.select("[data-togglable=example/jvm]").single().brief) + assertEquals("JS implementation of getTimeInMillis", content.select("[data-togglable=example/js]").single().brief) } } } @@ -60,10 +61,10 @@ class DivergentSignatureTest : AbstractRenderingTest() { ) { renderingStage = { _, _ -> val content = writerPlugin.renderedSourceDependentContent("example/example/-clock/get-year.html") - assert(content.count() == 3) - assert(content.select("[data-togglable=example/jvm]").single().brief == "JVM custom kdoc") - assert(content.select("[data-togglable=example/js]").single().brief == "JS custom kdoc") - assert(content.select("[data-togglable=example/common]").single().brief == "") + assertEquals(3, content.count()) + assertEquals("JVM custom kdoc", content.select("[data-togglable=example/jvm]").single().brief) + assertEquals("JS custom kdoc", content.select("[data-togglable=example/js]").single().brief) + assertEquals("", content.select("[data-togglable=example/common]").single().brief) } } } diff --git a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt index 588b3d50..8a4a8fd5 100644 --- a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt @@ -3,9 +3,13 @@ package signatures import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.jdk -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import utils.* +import utils.A +import utils.Span +import utils.TestOutputWriterPlugin +import utils.match +import utils.JavaCode +import kotlin.test.Ignore +import kotlin.test.Test class FunctionalTypeConstructorsSignatureTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { @@ -143,7 +147,7 @@ class FunctionalTypeConstructorsSignatureTest : BaseAbstractTest() { } } } - @Disabled // Add coroutines on classpath and get proper import + @Ignore // Add coroutines on classpath and get proper import @Test fun `kotlin normal suspendable function`() { val source = source("val nF: SuspendFunction1<Int, String> = { _ -> \"\" }") diff --git a/plugins/base/src/test/kotlin/signatures/InheritedAccessorsSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/InheritedAccessorsSignatureTest.kt index 4cd9a94d..d4600012 100644 --- a/plugins/base/src/test/kotlin/signatures/InheritedAccessorsSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/InheritedAccessorsSignatureTest.kt @@ -2,8 +2,13 @@ package signatures import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test -import utils.* +import utils.A +import utils.Span +import utils.TestOutputWriterPlugin +import utils.match +import utils.JavaCode +import utils.OnlyDescriptors +import kotlin.test.Test import kotlin.test.assertEquals @JavaCode diff --git a/plugins/base/src/test/kotlin/signatures/RawHtmlRenderingTest.kt b/plugins/base/src/test/kotlin/signatures/RawHtmlRenderingTest.kt index 38c70cd4..87763e48 100644 --- a/plugins/base/src/test/kotlin/signatures/RawHtmlRenderingTest.kt +++ b/plugins/base/src/test/kotlin/signatures/RawHtmlRenderingTest.kt @@ -1,8 +1,8 @@ package signatures import org.jsoup.Jsoup -import org.junit.jupiter.api.Test import utils.TestOutputWriterPlugin +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -17,7 +17,7 @@ class RawHtmlRenderingTest: AbstractRenderingTest() { ) { renderingStage = { _, _ -> val content = writerPlugin.renderedSourceDependentContent("example/example/-html-test/test.html") - assert(content.count() == 1) + assertEquals(1, content.count()) assertEquals(content.select("[data-togglable=example/jvm]").single().rawBrief,"This is an example <!-- not visible --> of html") val indexContent = writerPlugin.writer.contents.getValue("example/example/-html-test/index.html") @@ -54,7 +54,7 @@ class RawHtmlRenderingTest: AbstractRenderingTest() { ) { renderingStage = { _, _ -> val content = writerPlugin.renderedSourceDependentContent("example/example/-html-test/test-p.html") - assert(content.count() == 1) + assertEquals(1, content.count()) assertEquals(content.select("[data-togglable=example/jvm]").single().rawBrief, "This is an <b> documentation </b>") val indexContent = writerPlugin.writer.contents.getValue("example/example/-html-test/index.html") @@ -63,4 +63,4 @@ class RawHtmlRenderingTest: AbstractRenderingTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt index 00d98102..3a73153a 100644 --- a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt @@ -5,9 +5,11 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.DefinitelyNonNullable import org.jetbrains.dokka.model.dfs -import org.junit.jupiter.api.Test import utils.* +import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue + class SignatureTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { sourceSets { @@ -204,8 +206,8 @@ class SignatureTest : BaseAbstractTest() { documentablesTransformationStage = { val fn = (it.dfs { it.name == "elvisLike" } as? DFunction).assertNotNull("Function elvisLike") - assert(fn.type is DefinitelyNonNullable) - assert(fn.parameters[1].type is DefinitelyNonNullable) + assertTrue(fn.type is DefinitelyNonNullable) + assertTrue(fn.parameters[1].type is DefinitelyNonNullable) } renderingStage = { _, _ -> val signature = writerPlugin.writer.renderedContent("root/example/elvis-like.html") diff --git a/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt index 06a3daae..f8ad218c 100644 --- a/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt @@ -1,10 +1,10 @@ package signatures import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import utils.A import utils.TestOutputWriterPlugin import utils.match +import kotlin.test.Test class VarianceSignatureTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/superFields/DescriptorSuperPropertiesTest.kt b/plugins/base/src/test/kotlin/superFields/DescriptorSuperPropertiesTest.kt index 14c2752a..e2dc20a2 100644 --- a/plugins/base/src/test/kotlin/superFields/DescriptorSuperPropertiesTest.kt +++ b/plugins/base/src/test/kotlin/superFields/DescriptorSuperPropertiesTest.kt @@ -6,11 +6,11 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.InheritedMember import org.jetbrains.dokka.model.IsVar import org.jetbrains.dokka.model.KotlinVisibility -import org.junit.jupiter.api.Test -import utils.JavaCode +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull +import utils.JavaCode @JavaCode class DescriptorSuperPropertiesTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/superFields/PsiSuperFieldsTest.kt b/plugins/base/src/test/kotlin/superFields/PsiSuperFieldsTest.kt index 5c7124cd..ddcfdd75 100644 --- a/plugins/base/src/test/kotlin/superFields/PsiSuperFieldsTest.kt +++ b/plugins/base/src/test/kotlin/superFields/PsiSuperFieldsTest.kt @@ -6,12 +6,11 @@ import org.jetbrains.dokka.model.Annotations import org.jetbrains.dokka.model.InheritedMember import org.jetbrains.dokka.model.IsVar import org.jetbrains.dokka.model.isJvmField -import org.junit.jupiter.api.Assertions.assertNotNull -import org.junit.jupiter.api.Assertions.assertNull -import org.junit.jupiter.api.Test -import utils.JavaCode +import kotlin.test.Test import kotlin.test.assertEquals - +import kotlin.test.assertNotNull +import kotlin.test.assertNull +import utils.JavaCode @JavaCode class PsiSuperFieldsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt index b2b590d3..62741945 100644 --- a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt +++ b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt @@ -11,11 +11,9 @@ import org.jetbrains.dokka.transformers.pages.PageTransformer import org.jetbrains.dokka.transformers.pages.pageMapper import org.jetbrains.dokka.transformers.pages.pageScanner import org.jetbrains.dokka.transformers.pages.pageStructureTransformer -import org.jsoup.Jsoup -import org.junit.jupiter.api.Test -import utils.TestOutputWriterPlugin -import utils.assertContains import utils.assertNotNull +import kotlin.test.Test +import kotlin.test.assertEquals class PageTransformerBuilderTest : BaseAbstractTest() { @@ -178,11 +176,10 @@ class PageTransformerBuilderTest : BaseAbstractTest() { } private fun <T> Collection<T>.assertCount(n: Int, prefix: String = "") = - assert(count() == n) { "${prefix}Expected $n, got ${count()}" } + assertEquals(n, count(), "${prefix}Expected $n, got ${count()}") - private fun <T> T.assertEqual(expected: T, prefix: String = "") = assert(this == expected) { - "${prefix}Expected $expected, got $this" - } + private fun <T> T.assertEqual(expected: T, prefix: String = "") = + assertEquals(expected, this, "${prefix}Expected $expected, got $this") private fun PageNode.assertTransform(expected: PageNode, block: (PageNode) -> PageNode = { it }): Unit = this.let { it.name.assertEqual(block(expected).name) diff --git a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt index e1029856..a88503b0 100644 --- a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt +++ b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt @@ -5,9 +5,9 @@ import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConve import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue class CommentsToContentConverterTest { private val converter = DocTagToContentConverter() @@ -454,23 +454,23 @@ class CommentsToContentConverterTest { executeTest(docTag) { composite<ContentList> { check { - assertTrue(style.contains(ListStyle.DescriptionList)) { "Expected DL style" } + assertTrue(style.contains(ListStyle.DescriptionList), "Expected DL style") } group { check { - assertTrue(style.contains(ListStyle.DescriptionTerm)) { "Expected DT style" } + assertTrue(style.contains(ListStyle.DescriptionTerm), "Expected DT style") } +"description list can have..." } group { check { - assertTrue(style.contains(ListStyle.DescriptionTerm)) { "Expected DT style" } + assertTrue(style.contains(ListStyle.DescriptionTerm), "Expected DT style") } +"... two consecutive description terms" } group { check { - assertTrue(style.contains(ListStyle.DescriptionDetails)) { "Expected DD style" } + assertTrue(style.contains(ListStyle.DescriptionDetails), "Expected DD style") } +"and usually has some sort of a description, like this one" } diff --git a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt index 8d2833e4..34c218aa 100644 --- a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt +++ b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt @@ -1,6 +1,7 @@ package transformers import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.plugability.DokkaContext @@ -9,14 +10,13 @@ import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.testApi.logger.TestLogger import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.LoggingLevel -import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows import testApi.testRunner.TestDokkaConfigurationBuilder import testApi.testRunner.dModule import testApi.testRunner.dPackage +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAndPackageDocumentationReaderTest() { @@ -24,7 +24,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd private val includeSourceSetA by lazy { temporaryDirectory.resolve("includeA.md").toFile() } private val includeSourceSetB by lazy { temporaryDirectory.resolve("includeB.md").toFile() } - @BeforeEach + @BeforeTest fun materializeIncludes() { includeSourceSetA.writeText( """ @@ -107,14 +107,14 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd fun `assert moduleA with no source sets`() { val documentation = reader.read(dModule("moduleA")) assertEquals( - emptyMap<DokkaSourceSet, DocumentationNode>(), documentation, + emptyMap(), documentation, "Expected no documentation received for module not declaring a matching sourceSet" ) } @Test fun `assert moduleA with unknown source set`() { - assertThrows<IllegalStateException>( + assertFailsWith<IllegalStateException>( "Expected no documentation received for module with unknown sourceSet" ) { reader.read( diff --git a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt index 7195eccd..597c58c2 100644 --- a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt +++ b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt @@ -1,23 +1,23 @@ package transformers +import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.LoggingLevel -import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test import testApi.testRunner.TestDokkaConfigurationBuilder import testApi.testRunner.dPackage +import kotlin.test.BeforeTest +import kotlin.test.Test import kotlin.test.assertEquals class ContextModuleAndPackageDocumentationReaderTest3 : AbstractContextModuleAndPackageDocumentationReaderTest() { private val include by lazy { temporaryDirectory.resolve("include.md").toFile() } - @BeforeEach + @BeforeTest fun materializeInclude() { include.writeText( """ diff --git a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt index 16798508..2e9fbaa1 100644 --- a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt +++ b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt @@ -9,7 +9,7 @@ import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentHeader import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.ContentText -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull diff --git a/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt b/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt index 826df64e..d8811bcd 100644 --- a/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt +++ b/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt @@ -2,10 +2,10 @@ package transformers import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DEnum -import org.junit.jupiter.api.Test -import utils.OnlyDescriptors +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue +import utils.OnlyDescriptors class InheritedEntriesDocumentableFilterTransformerTest : BaseAbstractTest() { val suppressingInheritedConfiguration = dokkaConfiguration { @@ -155,4 +155,5 @@ class InheritedEntriesDocumentableFilterTransformerTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} + diff --git a/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt b/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt index 3ec1d273..e3b396a1 100644 --- a/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt +++ b/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt @@ -1,15 +1,15 @@ package transformers +import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.utilities.DokkaConsoleLogger import org.jetbrains.dokka.utilities.LoggingLevel -import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test import testApi.testRunner.TestDokkaConfigurationBuilder import testApi.testRunner.dModule +import kotlin.test.BeforeTest +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -19,7 +19,7 @@ class InvalidContentModuleAndPackageDocumentationReaderTest : AbstractContextMod private val includeA by lazy { temporaryDirectory.resolve("includeA.md").toFile() } private val includeB by lazy { temporaryDirectory.resolve("includeB.md").toFile() } - @BeforeEach + @BeforeTest fun materializeInclude() { includeA.writeText( """ diff --git a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt index e6cc393d..cdb19299 100644 --- a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt +++ b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt @@ -8,11 +8,11 @@ import org.jetbrains.dokka.model.childrenOfType import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.firstChildOfType import org.jetbrains.dokka.pages.* -import org.junit.jupiter.api.Test -import utils.OnlyDescriptors import utils.assertNotNull +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull +import utils.OnlyDescriptors class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerFunctionalTest.kt b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerFunctionalTest.kt index 134e7f59..7bf3c9c1 100644 --- a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerFunctionalTest.kt +++ b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerFunctionalTest.kt @@ -2,11 +2,11 @@ package transformers import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir import transformers.AbstractContextModuleAndPackageDocumentationReaderTest.Companion.texts import utils.OnlyDescriptorsMPP import java.nio.file.Path +import kotlin.test.Test import kotlin.test.assertEquals class ModuleAndPackageDocumentationTransformerFunctionalTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt index 3cbb90ca..d404c6f1 100644 --- a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt +++ b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt @@ -2,6 +2,7 @@ package transformers import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.analysis.kotlin.internal.ModuleAndPackageDocumentationReader import org.jetbrains.dokka.analysis.markdown.jb.MARKDOWN_ELEMENT_FILE_NAME import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationTransformer import org.jetbrains.dokka.links.DRI @@ -12,11 +13,10 @@ import org.jetbrains.dokka.model.doc.CustomDocTag import org.jetbrains.dokka.model.doc.Description import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.doc.Text -import org.jetbrains.dokka.analysis.kotlin.internal.ModuleAndPackageDocumentationReader -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test import testApi.testRunner.dPackage import testApi.testRunner.sourceSet +import kotlin.test.Test +import kotlin.test.assertEquals class ModuleAndPackageDocumentationTransformerUnitTest { diff --git a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt index 431abef5..88fc7a9d 100644 --- a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt +++ b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt @@ -5,9 +5,9 @@ import org.jetbrains.dokka.DokkaDefaults import org.jetbrains.dokka.PackageOptionsImpl import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test +import kotlin.test.Ignore +import kotlin.test.Test +import kotlin.test.assertEquals class ReportUndocumentedTransformerTest : BaseAbstractTest() { @@ -181,7 +181,7 @@ class ReportUndocumentedTransformerTest : BaseAbstractTest() { } } - @Disabled + @Ignore @Test fun `undocumented secondary constructor gets reported`() { val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt index 532c9e81..a6ae5d7c 100644 --- a/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt +++ b/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt @@ -4,11 +4,11 @@ import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.SourceLinkDefinitionImpl import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jsoup.nodes.Element -import org.junit.jupiter.api.Test import signatures.renderedContent import utils.OnlyDescriptorsMPP import utils.TestOutputWriterPlugin import java.net.URL +import kotlin.test.Test import kotlin.test.assertEquals class SourceLinkTransformerTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt b/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt index de1ee46c..e6059e85 100644 --- a/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt +++ b/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt @@ -3,7 +3,7 @@ package transformers import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.WithCompanion -import org.junit.jupiter.api.Test +import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -204,4 +204,4 @@ class SuppressTagFilterTest : BaseAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt index a6060970..377c8bec 100644 --- a/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt +++ b/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt @@ -4,9 +4,8 @@ import org.jetbrains.dokka.DokkaDefaults import org.jetbrains.dokka.PackageOptionsImpl import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertIterableEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals class SuppressedByConfigurationDocumentableFilterTransformerTest : BaseAbstractTest() { @@ -90,7 +89,7 @@ class SuppressedByConfigurationDocumentableFilterTransformerTest : BaseAbstractT ) { documentablesMergingStage = { module -> assertEquals(2, module.packages.size, "Expected two packages in module") - assertIterableEquals( + assertEquals( listOf(DRI("parent.some"), DRI("parent.other.default")).sortedBy { it.packageName }, module.packages.map { it.dri }.sortedBy { it.packageName }, "Expected 'parent.some' and 'parent.other.default' packages to be not suppressed" diff --git a/plugins/base/src/test/kotlin/transformers/isExceptionTest.kt b/plugins/base/src/test/kotlin/transformers/isExceptionTest.kt index dd888ad6..b1ad7163 100644 --- a/plugins/base/src/test/kotlin/transformers/isExceptionTest.kt +++ b/plugins/base/src/test/kotlin/transformers/isExceptionTest.kt @@ -3,8 +3,8 @@ package transformers import org.jetbrains.dokka.base.transformers.documentables.isException import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DTypeAlias -import org.junit.jupiter.api.Test import utils.AbstractModelTest +import kotlin.test.Test import utils.JavaCode import utils.UsingJDK @@ -147,4 +147,5 @@ class IsExceptionJavaTest: AbstractModelTest("/src/main/kotlin/java/Test.java", } } } -}
\ No newline at end of file +} + diff --git a/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt b/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt index dee4bf7a..6f928266 100644 --- a/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt +++ b/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt @@ -2,9 +2,9 @@ package translators import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DProperty -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue /** * https://kotlinlang.org/docs/java-to-kotlin-interop.html#properties diff --git a/plugins/base/src/test/kotlin/translators/Bug1341.kt b/plugins/base/src/test/kotlin/translators/Bug1341.kt index 3e1b403d..97d75334 100644 --- a/plugins/base/src/test/kotlin/translators/Bug1341.kt +++ b/plugins/base/src/test/kotlin/translators/Bug1341.kt @@ -2,8 +2,8 @@ package translators import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals import utils.JavaCode class Bug1341 : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt index 4ae8f7ac..c8411f31 100644 --- a/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt +++ b/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt @@ -7,13 +7,9 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* -import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import utils.OnlyDescriptors import utils.text -import kotlin.test.assertNotNull -import kotlin.test.assertTrue +import kotlin.test.* +import utils.OnlyDescriptors class DefaultDescriptorToDocumentableTranslatorTest : BaseAbstractTest() { val configuration = dokkaConfiguration { @@ -60,16 +56,17 @@ class DefaultDescriptorToDocumentableTranslatorTest : BaseAbstractTest() { configuration ) { documentablesMergingStage = { module -> - assert(module.documentationOf("XD", "copy") == "") - assert( + assertEquals("", module.documentationOf("XD", "copy")) + assertEquals( + "Memory is not what the heart desires. That is only a mirror.", module.documentationOf( "XD", "equals" - ) == "Memory is not what the heart desires. That is only a mirror." + ) ) - assert(module.documentationOf("XD", "hashCode") == "") - assert(module.documentationOf("XD", "toString") == "") - assert(module.documentationOf("XD", "custom") == "But the fat Hobbit, he knows. Eyes always watching.") + assertEquals("", module.documentationOf("XD", "hashCode")) + assertEquals("", module.documentationOf("XD", "toString")) + assertEquals("But the fat Hobbit, he knows. Eyes always watching.", module.documentationOf("XD", "custom")) } } } @@ -98,12 +95,13 @@ class DefaultDescriptorToDocumentableTranslatorTest : BaseAbstractTest() { configuration ) { documentablesMergingStage = { module -> - assert(module.documentationOf("XD", "custom") == "But the fat Hobbit, he knows. Eyes always watching.") - assert( + assertEquals("But the fat Hobbit, he knows. Eyes always watching.", module.documentationOf("XD", "custom")) + assertEquals( + "Memory is not what the heart desires. That is only a mirror.", module.documentationOf( "XD", "equals" - ) == "Memory is not what the heart desires. That is only a mirror." + ) ) } } @@ -656,7 +654,7 @@ val soapXml = node("soap-env:Envelope", soapAttrs, } } - @Disabled // The compiler throws away annotations on unresolved types upstream + @Ignore // The compiler throws away annotations on unresolved types upstream @Test fun `Can annotate unresolved type`() { testInline( @@ -813,7 +811,7 @@ val soapXml = node("soap-env:Envelope", soapAttrs, val testFunction = module.packages.find { it.name == "com.example" } ?.functions ?.single { it.name == "foo" } - checkNotNull(testFunction) + assertNotNull(testFunction) val documentationTags = testFunction.documentation.values.single().children assertEquals(7, documentationTags.size) @@ -873,7 +871,7 @@ val soapXml = node("soap-env:Envelope", soapAttrs, val kotlinEnum = module.packages.find { it.name == "test" } ?.classlikes ?.single { it.name == "KotlinEnum" } - checkNotNull(kotlinEnum) + assertNotNull(kotlinEnum) val valuesFunction = kotlinEnum.functions.single { it.name == "values" } val expectedValuesType = GenericTypeConstructor( @@ -936,7 +934,7 @@ val soapXml = node("soap-env:Envelope", soapAttrs, ?.classlikes ?.single { it.name == "KotlinEnum" } - checkNotNull(kotlinEnum) + assertNotNull(kotlinEnum) val entriesProperty = kotlinEnum.properties.single { it.name == "entries" } val expectedEntriesType = GenericTypeConstructor( @@ -999,7 +997,7 @@ val soapXml = node("soap-env:Envelope", soapAttrs, val kotlinEnum = module.packages.find { it.name == "test" } ?.classlikes ?.single { it.name == "KotlinEnum" } - checkNotNull(kotlinEnum) + assertNotNull(kotlinEnum) val expectedValueOfType = GenericTypeConstructor( dri = DRI( @@ -1067,9 +1065,9 @@ val soapXml = node("soap-env:Envelope", soapAttrs, val pckg = module.packages.single { it.name == "test" } val dataObject = pckg.classlikes.single { it.name == "KotlinDataObject" } - assertInstanceOf(DObject::class.java, dataObject) + assertTrue(dataObject is DObject) - val modifiers = (dataObject as DObject).modifiers().values.flatten() + val modifiers = dataObject.modifiers().values.flatten() assertEquals(1, modifiers.size) assertEquals(ExtraModifiers.KotlinOnlyModifiers.Data, modifiers[0]) } diff --git a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt index b3f83d79..b75bc8e7 100644 --- a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt +++ b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt @@ -1,17 +1,13 @@ package translators import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.DokkaConfiguration.Visibility import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* -import org.jetbrains.dokka.plugability.DokkaPlugin -import org.jetbrains.dokka.plugability.DokkaPluginApiPreview -import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement -import org.jetbrains.dokka.DokkaConfiguration.Visibility -import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.Test +import kotlin.test.* import utils.JavaCode @JavaCode @@ -303,7 +299,7 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val testedClass = module.packages.single().classlikes.single { it.name == "JavaClassUsingAnnotation" } val annotation = (testedClass as DClass).extra[Annotations]?.directAnnotations?.values?.single()?.single() - checkNotNull(annotation) + assertNotNull(annotation) assertEquals("JavaAnnotation", annotation.dri.classNames) @@ -404,9 +400,7 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val testClass = module.packages.single().classlikes.single { it.name == "A" } val getterLookalikes = testClass.functions.filter { it.name == "getA" } - assertEquals(2, getterLookalikes.size) { - "Not all expected regular functions found, wrongly categorized as getters?" - } + assertEquals(2, getterLookalikes.size, "Not all expected regular functions found, wrongly categorized as getters?") } } } @@ -444,8 +438,8 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val setter = property.setter assertNotNull(setter) - assertEquals(1, setter?.parameters?.size) - assertEquals(PrimitiveJavaType("int"), setter?.parameters?.get(0)?.type) + assertEquals(1, setter.parameters.size) + assertEquals(PrimitiveJavaType("int"), setter.parameters[0].type) val regularSetterFunctions = testClass.functions.filter { it.name == "setA" } assertEquals(4, regularSetterFunctions.size) @@ -489,12 +483,14 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { assertNotNull(field) { "Expected the foo property to exist because the field is private with a public getter" } - assertNull(requireNotNull(field).setter) + assertNull(field.setter) val setterMethodsWithSubtypeParams = testClass.functions.filter { it.name == "setFoo" } - assertEquals(2, setterMethodsWithSubtypeParams.size) { + assertEquals( + 2, + setterMethodsWithSubtypeParams.size, "Expected the setter methods to not qualify as accessors because of subtype parameters" - } + ) } } } @@ -517,9 +513,7 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val tetClass = module.packages.single().classlikes.single { it.name == "A" } val property = tetClass.properties.firstOrNull { it.name == "a" } - assertNull(property) { - "Expected the property to stay private because there are no getters" - } + assertNull(property, "Expected the property to stay private because there are no getters") val regularSetterFunction = tetClass.functions.firstOrNull { it.name == "setA" } assertNotNull(regularSetterFunction) { @@ -757,7 +751,7 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val kotlinEnum = module.packages.find { it.name == "test" } ?.classlikes ?.single { it.name == "JavaEnum" } - checkNotNull(kotlinEnum) + assertNotNull(kotlinEnum) val valuesFunction = kotlinEnum.functions.single { it.name == "values" } @@ -826,7 +820,7 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() { val javaEnum = module.packages.find { it.name == "test" } ?.classlikes ?.single { it.name == "JavaEnum" } - checkNotNull(javaEnum) + assertNotNull(javaEnum) val valueOfFunction = javaEnum.functions.single { it.name == "valueOf" } diff --git a/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt b/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt index c4087b20..56ecf06a 100644 --- a/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt +++ b/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt @@ -1,15 +1,15 @@ package translators +import org.jetbrains.dokka.analysis.kotlin.internal.ExternalDocumentablesProvider +import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DInterface import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.utilities.cast -import org.jetbrains.dokka.analysis.kotlin.internal.ExternalDocumentablesProvider -import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test +import kotlin.test.Test +import kotlin.test.assertEquals import utils.OnlyDescriptors import utils.UsingJDK diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt index a357491f..0434a662 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt @@ -5,9 +5,9 @@ import org.jetbrains.dokka.model.doc.CustomDocTag import org.jetbrains.dokka.model.doc.Description import org.jetbrains.dokka.model.doc.P import org.jetbrains.dokka.model.doc.Text -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test +import kotlin.test.Ignore +import kotlin.test.Test +import kotlin.test.assertEquals import utils.JavaCode @JavaCode @@ -132,7 +132,7 @@ class JavadocInheritDocsTest : BaseAbstractTest() { } @Test - @Disabled("This should be enabled when we have proper tag inheritance in javadoc parser") + @Ignore // This should be enabled when we have proper tag inheritance in javadoc parser fun `work when inherited part is empty in supertype but present in its supertype`() { testInline( """ diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt index 1e3d784a..15bc31ed 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt @@ -5,11 +5,11 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.doc.* -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import utils.JavaCode +import kotlin.test.Test +import kotlin.test.assertEquals import org.jetbrains.dokka.model.doc.Deprecated as DokkaDeprecatedTag import org.jetbrains.dokka.model.doc.Throws as DokkaThrowsTag +import utils.JavaCode @JavaCode class JavadocInheritedDocTagsTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt index 8bc307df..85a5e9cf 100644 --- a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt +++ b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt @@ -7,10 +7,10 @@ import org.jetbrains.dokka.model.childrenOfType import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.firstChildOfType import org.jetbrains.dokka.model.firstMemberOfType -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Test -import utils.JavaCode import utils.text +import kotlin.test.Test +import kotlin.test.assertEquals +import utils.JavaCode @JavaCode class JavadocParserTest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index 8cb126d5..8b794af0 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -4,10 +4,11 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.doc.P -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertTrue import kotlin.collections.orEmpty +import kotlin.test.assertEquals +import kotlin.test.assertTrue import kotlin.test.asserter +import kotlin.test.fail @DslMarker annotation class TestDSL @@ -25,7 +26,7 @@ abstract class ModelDSL : BaseAbstractTest() { interface AssertDSL { infix fun Any?.equals(other: Any?) = assertEquals(other, this) infix fun Collection<Any>?.allEquals(other: Any?) = - this?.onEach { it equals other } ?: run { assert(false) { "Collection is empty" } } + this?.onEach { it equals other } ?: run { fail("Collection is empty") } infix fun <T> Collection<T>?.exists(e: T) { assertTrue(this.orEmpty().isNotEmpty(), "Collection cannot be null or empty") assertTrue(this!!.any{it == e}, "Collection doesn't contain $e") @@ -36,7 +37,7 @@ interface AssertDSL { infix fun <T> T?.notNull(name: String): T = this.assertNotNull(name) fun <T> Collection<T>.assertCount(n: Int, prefix: String = "") = - assert(count() == n) { "${prefix}Expected $n, got ${count()}" } + assertEquals(n, count(), "${prefix}Expected $n, got ${count()}") } /* |