aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/content
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/content')
-rw-r--r--plugins/base/src/test/kotlin/content/ContentInDescriptionTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/HighlightingTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt8
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt23
-rw-r--r--plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt7
-rw-r--r--plugins/base/src/test/kotlin/content/functions/ContentForBriefTest.kt6
-rw-r--r--plugins/base/src/test/kotlin/content/functions/ContentForConstructors.kt7
-rw-r--r--plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt8
-rw-r--r--plugins/base/src/test/kotlin/content/properties/ContentForClassWithParamsAndPropertiesTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/receiver/ContentForReceiverTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/samples/ContentForSamplesTest.kt9
-rw-r--r--plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/typealiases/TypealiasTest.kt7
18 files changed, 59 insertions, 50 deletions
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
+}