aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/basic/DRITest.kt2
-rw-r--r--plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt3
-rw-r--r--plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt9
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt5
-rw-r--r--plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt12
-rw-r--r--plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt1
-rw-r--r--plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt10
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt42
-rw-r--r--plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt15
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/markdown/KDocTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/markdown/LinkTest.kt6
-rw-r--r--plugins/base/src/test/kotlin/markdown/ParserTest.kt99
-rw-r--r--plugins/base/src/test/kotlin/model/ClassesTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/model/CommentTest.kt6
-rw-r--r--plugins/base/src/test/kotlin/model/ExtensionsTest.kt9
-rw-r--r--plugins/base/src/test/kotlin/model/InheritorsTest.kt435
-rw-r--r--plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/model/PropertyTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt72
-rw-r--r--plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt282
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt4
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt1
-rw-r--r--plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt3
-rw-r--r--plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt28
-rw-r--r--plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt8
-rw-r--r--plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt7
-rw-r--r--plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt12
-rw-r--r--plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt36
-rw-r--r--plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/translators/Bug1341.kt2
-rw-r--r--plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt137
-rw-r--r--plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt19
-rw-r--r--plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt13
-rw-r--r--plugins/base/src/test/kotlin/translators/JavadocParserTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/translators/utils.kt1
-rw-r--r--plugins/base/src/test/kotlin/utils/contentUtils.kt7
63 files changed, 564 insertions, 843 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt
index 3a4ff84d..9c443567 100644
--- a/plugins/base/src/test/kotlin/basic/DRITest.kt
+++ b/plugins/base/src/test/kotlin/basic/DRITest.kt
@@ -1,5 +1,6 @@
package basic
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.*
import org.jetbrains.dokka.links.Callable
import org.jetbrains.dokka.links.Nullable
@@ -8,7 +9,6 @@ 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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
diff --git a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt
index 35e4e52f..d4e307be 100644
--- a/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt
+++ b/plugins/base/src/test/kotlin/basic/DokkaBasicTests.kt
@@ -1,10 +1,9 @@
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.Assertions.assertTrue
import org.junit.jupiter.api.Test
-import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
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 682a257e..bd8a79ef 100644
--- a/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt
+++ b/plugins/base/src/test/kotlin/basic/FailOnWarningTest.kt
@@ -1,8 +1,8 @@
package basic
import org.jetbrains.dokka.DokkaException
-import org.jetbrains.dokka.testApi.logger.TestLogger
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+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
diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt
index f7f7eb66..2659fd86 100644
--- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt
+++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt
@@ -1,15 +1,14 @@
package content.annotations
import matchers.content.*
-import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.jetbrains.dokka.base.utils.firstNotNullOfOrNull
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.*
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.jetbrains.kotlin.util.firstNotNullResult
import org.junit.jupiter.api.Test
import utils.ParamAttributes
import utils.assertNotNull
@@ -223,7 +222,7 @@ class ContentForAnnotationsTest : BaseAbstractTest() {
))
val property = modules.flatMap { it.packages }.flatMap { it.properties }.first()
val annotation = property.extra[Annotations]?.let {
- it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() }
+ it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations) -> annotations.firstOrNull() }
}
val annotationParams = annotation?.params ?: emptyMap()
@@ -284,10 +283,10 @@ class ContentForAnnotationsTest : BaseAbstractTest() {
val property = modules.flatMap { it.packages }.flatMap { it.properties }.first()
val getterAnnotation = property.getter?.extra?.get(Annotations)?.let {
- it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() }
+ it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations) -> annotations.firstOrNull() }
}
val setterAnnotation = property.getter?.extra?.get(Annotations)?.let {
- it.directAnnotations.entries.firstNotNullResult { (_, annotations) -> annotations.firstOrNull() }
+ it.directAnnotations.entries.firstNotNullOfOrNull { (_, annotations) -> annotations.firstOrNull() }
}
assertEquals(expectedAnnotation("xd"), getterAnnotation)
diff --git a/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt b/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt
index 8b311893..83517254 100644
--- a/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt
+++ b/plugins/base/src/test/kotlin/content/annotations/KotlinDeprecatedTest.kt
@@ -1,13 +1,13 @@
package content.annotations
import matchers.content.*
-import org.jetbrains.dokka.pages.ContentPage
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.base.transformers.documentables.deprecatedAnnotation
-import org.jetbrains.dokka.pages.ContentStyle
import org.jetbrains.dokka.base.transformers.documentables.isDeprecated
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
diff --git a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
index d658b50b..0b36031c 100644
--- a/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
+++ b/plugins/base/src/test/kotlin/content/annotations/SinceKotlinTest.kt
@@ -9,7 +9,9 @@ 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.*
+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
diff --git a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt
index f59ba529..14a36611 100644
--- a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt
+++ b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt
@@ -6,7 +6,6 @@ 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.jetbrains.kotlin.utils.addIfNotNull
import org.junit.jupiter.api.Test
import utils.ParamAttributes
import utils.bareSignature
@@ -47,7 +46,7 @@ class ContentForExceptions : BaseAbstractTest() {
sourceRoots = listOf("src/linuxX64Main/kotlin/pageMerger/Test.kt")
}
}
- pluginsConfigurations.addIfNotNull(
+ pluginsConfigurations.add(
PluginConfigurationImpl(
DokkaBase::class.qualifiedName!!,
DokkaConfiguration.SerializationFormat.JSON,
@@ -431,4 +430,4 @@ class ContentForExceptions : 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/inheritors/ContentForInheritorsTest.kt b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt
index 09c927bd..e5059073 100644
--- a/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt
+++ b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt
@@ -5,7 +5,6 @@ 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.jetbrains.kotlin.utils.addIfNotNull
import org.junit.jupiter.api.Test
import utils.classSignature
import utils.findTestType
@@ -45,7 +44,7 @@ class ContentForInheritorsTest : BaseAbstractTest() {
sourceRoots = listOf("src/linuxX64Main/kotlin/pageMerger/Test.kt")
}
}
- pluginsConfigurations.addIfNotNull(
+ pluginsConfigurations.add(
PluginConfigurationImpl(
DokkaBase::class.qualifiedName!!,
DokkaConfiguration.SerializationFormat.JSON,
@@ -491,4 +490,4 @@ class ContentForInheritorsTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
index 742c801f..e74cb49d 100644
--- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
+++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.model.doc.DocumentationNode
import org.jetbrains.dokka.model.doc.Param
import org.jetbrains.dokka.model.doc.Text
import org.jetbrains.dokka.pages.*
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
+import org.jetbrains.dokka.utilities.firstIsInstanceOrNull
import org.junit.jupiter.api.Test
import utils.*
import kotlin.test.assertEquals
diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
index 3497317c..a39ade25 100644
--- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
+++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
@@ -2,10 +2,9 @@ package content.signatures
import matchers.content.*
import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.doc.Text
-import org.jetbrains.dokka.pages.*
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
diff --git a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
index b3d56d2e..1602a7cf 100644
--- a/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/JavaEnumsTest.kt
@@ -2,14 +2,11 @@ package enums
import org.jetbrains.dokka.SourceLinkDefinitionImpl
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.model.DEnum
-import org.jetbrains.dokka.model.ObviousMember
import org.junit.jupiter.api.Test
import signatures.renderedContent
import utils.TestOutputWriterPlugin
import java.net.URL
import kotlin.test.assertEquals
-import kotlin.test.assertNotNull
class JavaEnumsTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
index 3b2720c9..a49a29de 100644
--- a/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
@@ -2,19 +2,19 @@ package enums
import matchers.content.*
import org.jetbrains.dokka.SourceLinkDefinitionImpl
-import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.model.*
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
+import org.jetbrains.dokka.model.DEnum
+import org.jetbrains.dokka.model.dfs
+import org.jetbrains.dokka.pages.ClasslikePage
+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.Disabled
import org.junit.jupiter.api.Test
import signatures.renderedContent
import utils.TestOutputWriter
import utils.TestOutputWriterPlugin
-import java.io.File
import java.net.URL
class KotlinEnumsTest : BaseAbstractTest() {
@@ -347,7 +347,7 @@ class KotlinEnumsTest : BaseAbstractTest() {
configuration
) {
pagesTransformationStage = { m ->
- val entryNode = m.children.first { it.name == "testpackage" }.children.first { it.name == "TestEnum" }.children.firstIsInstance<ClasslikePageNode>()
+ val entryNode = m.children.first { it.name == "testpackage" }.children.first { it.name == "TestEnum" }.children.filterIsInstance<ClasslikePageNode>().first()
val signature = (entryNode.content as ContentGroup).dfs { it is ContentGroup && it.dci.toString() == "[testpackage/TestEnum.E1///PointingToDeclaration/{\"org.jetbrains.dokka.links.EnumEntryDRIExtra\":{\"key\":\"org.jetbrains.dokka.links.EnumEntryDRIExtra\"}}][Cover]" } as ContentGroup
signature.assertNode {
diff --git a/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt b/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt
index 13d4b456..ff1b7989 100644
--- a/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt
+++ b/plugins/base/src/test/kotlin/expectActuals/ExpectActualsTest.kt
@@ -1,11 +1,10 @@
package expectActuals
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.withDescendants
import org.jetbrains.dokka.pages.ClasslikePageNode
-import org.jetbrains.dokka.pages.PageNode
-import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.assertTrue
+import org.junit.jupiter.api.Test
class ExpectActualsTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt b/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt
index f618292c..a1a242c5 100644
--- a/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt
+++ b/plugins/base/src/test/kotlin/filter/JavaFileFilterTest.kt
@@ -3,7 +3,6 @@ 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.assertEquals
class JavaFileFilterTest : BaseAbstractTest() {
@Test
diff --git a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt
index b9b1dc1e..de7c4e43 100644
--- a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt
+++ b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt
@@ -1,9 +1,11 @@
package filter
-import com.jetbrains.rd.util.firstOrNull
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.*
+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
@@ -124,7 +126,7 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() {
val arrTypealias = it.firstOrNull()?.packages?.firstOrNull()?.typealiases?.firstOrNull()
Assertions.assertEquals(GenericTypeConstructor(DRI("kotlin", "IntArray"), emptyList()),
- arrTypealias?.underlyingType?.firstOrNull()?.value)
+ arrTypealias?.underlyingType?.values?.firstOrNull())
}
}
}
@@ -196,4 +198,4 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index d7ac8b97..be75e01f 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -2,14 +2,11 @@ package linkableContent
import org.jetbrains.dokka.SourceLinkDefinitionImpl
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransformer
import org.jetbrains.dokka.base.transformers.pages.sourcelinks.SourceLinksTransformer
import org.jetbrains.dokka.model.WithGenerics
import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.Text
import org.jetbrains.dokka.pages.*
-import org.jetbrains.kotlin.utils.addToStdlib.cast
-import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.jsoup.Jsoup
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
@@ -135,8 +132,8 @@ class LinkableContentTest : BaseAbstractTest() {
Assertions.assertEquals(2, packageChildren.size)
packageChildren.forEach {
val name = it.name.substringBefore("Class")
- val signature = it.safeAs<ClasslikePageNode>()?.content?.dfs { it is ContentGroup && it.dci.kind == ContentKind.Symbol }.assertNotNull("signature")
- val crl = signature.children.last().children[1].safeAs<ContentResolvedLink>()
+ 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(
"https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3",
crl?.address
@@ -187,9 +184,10 @@ class LinkableContentTest : BaseAbstractTest() {
}
testFromData(configuration) {
- renderingStage = { rootPageNode, dokkaContext ->
- val newRoot = DefaultSamplesTransformer(dokkaContext).invoke(rootPageNode)
-
+ renderingStage = { rootPageNode, _ ->
+ // TODO [beresnev] :(((
+// val newRoot = DefaultSamplesTransformer(dokkaContext).invoke(rootPageNode)
+ val newRoot = rootPageNode
val moduleChildren = newRoot.children
Assertions.assertEquals(1, moduleChildren.size)
val packageChildren = moduleChildren.first().children
@@ -199,12 +197,12 @@ class LinkableContentTest : BaseAbstractTest() {
val classChildren = pageNode.children
Assertions.assertEquals(2, classChildren.size)
val function = classChildren.find { it.name == "printWithExclamation" }
- val text = function.cast<MemberPageNode>().content.cast<ContentGroup>().children.last()
- .cast<ContentDivergentGroup>().children.single()
- .cast<ContentDivergentInstance>().after
- .cast<ContentGroup>().children.last()
- .cast<ContentGroup>().children.single()
- .cast<ContentCodeBlock>().children.single().cast<ContentText>().text
+ val text = (function as MemberPageNode).content.let { it as ContentGroup }.children.last()
+ .let { it as ContentDivergentGroup }.children.single().after
+ .let { it as ContentGroup }.children.last()
+ .let { it as ContentGroup }.children.single()
+ .let { it as ContentCodeBlock }.children.single()
+ .let { it as ContentText }.text
Assertions.assertEquals(
"""|import p2.${name}Class
|fun main() {
@@ -245,16 +243,20 @@ class LinkableContentTest : BaseAbstractTest() {
) {
renderingStage = { module, _ ->
val sample = module.children.single { it.name == "test" }
- .children.single { it.name == "Sample" }.cast<ClasslikePageNode>()
+ .children.single { it.name == "Sample" } as ClasslikePageNode
val foo = sample
- .children.single { it.name == "SampleInner" }.cast<ClasslikePageNode>()
- .children.single { it.name == "foo" }.cast<MemberPageNode>()
+ .children
+ .single { it.name == "SampleInner" }
+ .let { it as ClasslikePageNode }
+ .children
+ .single { it.name == "foo" }
+ .let { it as MemberPageNode }
val returnTypeNode = foo.content.dfs {
- val link = it.safeAs<ContentDRILink>()?.children
- val child = link?.first().safeAs<ContentText>()
+ val link = (it as? ContentDRILink)?.children
+ val child = link?.first() as? ContentText
child?.text == "S"
- }?.safeAs<ContentDRILink>()
+ } as? ContentDRILink
Assertions.assertEquals(
(sample.documentables.firstOrNull() as WithGenerics).generics.first().dri,
diff --git a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt
index f95d9860..14875832 100644
--- a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt
+++ b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt
@@ -7,13 +7,12 @@ import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.DocumentationLink
import org.jetbrains.dokka.pages.ContentDRILink
import org.jetbrains.dokka.pages.ContentPage
-import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.jsoup.Jsoup
-import org.junit.jupiter.api.Assertions.*
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
-import java.nio.file.Paths
import utils.TestOutputWriterPlugin
-import kotlin.AssertionError
+import java.nio.file.Paths
class EnumValuesLinkingTest : BaseAbstractTest() {
@@ -80,13 +79,13 @@ class EnumValuesLinkingTest : BaseAbstractTest() {
}
assertEquals(
- javaLinker.documentation.values.single().children[0].children[1].children[1].safeAs<DocumentationLink>()?.dri,
- kotlinLinker.documentation.values.single().children[0].children[0].children[5].safeAs<DocumentationLink>()?.dri
+ javaLinker.documentation.values.single().children[0].children[1].children[1].let { it as? DocumentationLink }?.dri,
+ kotlinLinker.documentation.values.single().children[0].children[0].children[5].let { it as? DocumentationLink }?.dri
)
assertEquals(
- javaLinker.documentation.values.single().children[0].children[2].children[1].safeAs<DocumentationLink>()?.dri,
- kotlinLinker.documentation.values.single().children[0].children[0].children[9].safeAs<DocumentationLink>()?.dri
+ javaLinker.documentation.values.single().children[0].children[2].children[1].let { it as? DocumentationLink }?.dri,
+ kotlinLinker.documentation.values.single().children[0].children[0].children[9].let { it as? DocumentationLink }?.dri
)
}
diff --git a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
index 071997fc..e9e0871a 100644
--- a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
@@ -5,11 +5,11 @@ import org.jetbrains.dokka.base.resolvers.external.javadoc.AndroidExternalLocati
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.net.URL
diff --git a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
index 3a8aafa7..870d8cf3 100644
--- a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
@@ -3,11 +3,11 @@ package locationProvider
import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.net.URL
diff --git a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
index 80950747..241e0919 100644
--- a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
@@ -3,11 +3,11 @@ package locationProvider
import org.jetbrains.dokka.base.resolvers.external.Dokka010ExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.net.URL
diff --git a/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt
index 59406e1e..f43a4cd7 100644
--- a/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt
@@ -5,7 +5,6 @@ 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.jetbrains.kotlin.backend.common.push
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
@@ -49,7 +48,7 @@ class DokkaLocationProviderTest : BaseAbstractTest() {
class ModulesDsl(val pages: MutableList<ModulePageNode> = mutableListOf()) {
fun modulePage(name: String, fn: PackageDsl.() -> Unit) {
val packages = PackageDsl().also { it.fn() }
- pages.push(
+ pages.add(
ModulePageNode(
name = name,
children = packages.pages,
@@ -63,7 +62,7 @@ class DokkaLocationProviderTest : BaseAbstractTest() {
class PackageDsl(val pages: MutableList<PackagePageNode> = mutableListOf()) {
fun packagePage(name: String, fn: ClassDsl.() -> Unit) {
val packages = ClassDsl().also { it.fn() }
- pages.push(
+ pages.add(
PackagePageNode(
name = name,
children = packages.pages,
@@ -77,7 +76,7 @@ class DokkaLocationProviderTest : BaseAbstractTest() {
@TestNavigationDSL
class ClassDsl(val pages: MutableList<ClasslikePageNode> = mutableListOf()) {
fun classPage(name: String) {
- pages.push(
+ pages.add(
ClasslikePageNode(
name = name,
children = emptyList(),
diff --git a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt
index 95179e22..27e51caf 100644
--- a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt
@@ -4,9 +4,12 @@ import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvid
import org.jetbrains.dokka.base.resolvers.external.javadoc.JavadocExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
-import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.links.*
+import org.jetbrains.dokka.links.DRI
+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
diff --git a/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt b/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt
index aefe913c..031dd101 100644
--- a/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/MultiModuleLinkingTest.kt
@@ -3,11 +3,10 @@ package locationProvider
import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import java.net.URL
diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt
index fddd41e7..69885931 100644
--- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt
@@ -1,10 +1,10 @@
package markdown
+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.*
-import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.junit.jupiter.api.Assertions.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 f141bb06..526ff0eb 100644
--- a/plugins/base/src/test/kotlin/markdown/LinkTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt
@@ -1,13 +1,13 @@
package markdown
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.jetbrains.dokka.links.*
import org.jetbrains.dokka.model.WithGenerics
import org.jetbrains.dokka.model.dfs
+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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.links.*
-import org.jetbrains.dokka.model.doc.*
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
index fd723263..41b086ee 100644
--- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
@@ -1,8 +1,9 @@
package org.jetbrains.dokka.tests
import markdown.KDocTest
-import org.intellij.markdown.MarkdownElementTypes
-import org.jetbrains.dokka.base.parsers.MarkdownParser
+
+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
@@ -25,7 +26,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(Text("This is simple test of string Next line")))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -52,7 +53,7 @@ class ParserTest : KDocTest() {
)
)
),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -81,7 +82,7 @@ class ParserTest : KDocTest() {
B(listOf(I(listOf(Text("line")))))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -99,7 +100,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(Text("This is simple text with: colon!")))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -119,7 +120,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(Text("Text and String")))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -143,7 +144,7 @@ class ParserTest : KDocTest() {
listOf(
P(listOf(Text("Paragraph number one"))),
P(listOf(Text("Paragraph"), Br, Text("number two")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -159,7 +160,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(I(listOf(Text("text")))))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -175,7 +176,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(Text("text_with_underscores")))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -191,7 +192,7 @@ class ParserTest : KDocTest() {
Description(
CustomDocTag(
listOf(P(listOf(I(listOf(Text("text")))))),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -220,7 +221,7 @@ class ParserTest : KDocTest() {
Text("x\".")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -249,7 +250,7 @@ class ParserTest : KDocTest() {
Text("x\".")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -266,7 +267,7 @@ class ParserTest : KDocTest() {
CustomDocTag(
listOf(
P(listOf(Text("Embedded*Star")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -292,7 +293,7 @@ class ParserTest : KDocTest() {
Li(listOf(P(listOf(Text("list item 2")))))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -319,7 +320,7 @@ class ParserTest : KDocTest() {
Li(listOf(P(listOf(Text("list item 2"), Br, Text("continue 2")))))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -366,7 +367,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -414,7 +415,7 @@ class ParserTest : KDocTest() {
)
),
P(listOf(Text("New paragraph")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -440,7 +441,7 @@ class ParserTest : KDocTest() {
),
mapOf("start" to "1")
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -467,7 +468,7 @@ class ParserTest : KDocTest() {
),
mapOf("start" to "9")
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -495,7 +496,7 @@ class ParserTest : KDocTest() {
),
mapOf("start" to "2")
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -543,7 +544,7 @@ class ParserTest : KDocTest() {
),
mapOf("start" to "1")
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -594,7 +595,7 @@ class ParserTest : KDocTest() {
mapOf("start" to "1")
),
P(listOf(Text("New paragraph")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -644,7 +645,7 @@ class ParserTest : KDocTest() {
mapOf("start" to "1")
),
P(listOf(Text("New paragraph")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -668,7 +669,7 @@ class ParserTest : KDocTest() {
H1(listOf(Text("Header 1"))),
P(listOf(Text("Following text"))),
P(listOf(Text("New paragraph")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -710,7 +711,7 @@ class ParserTest : KDocTest() {
P(listOf(Text("Text 5"))),
H6(listOf(Text("Header 6"))),
P(listOf(Text("Text 6")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -736,7 +737,7 @@ class ParserTest : KDocTest() {
B(listOf(Text("line 2")))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -771,7 +772,7 @@ class ParserTest : KDocTest() {
HorizontalRule,
P(listOf(Text("text 4"))),
HorizontalRule
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -809,7 +810,7 @@ class ParserTest : KDocTest() {
P(listOf(Text("Quote")))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -854,7 +855,7 @@ class ParserTest : KDocTest() {
P(listOf(Text("Quote")))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -916,7 +917,7 @@ class ParserTest : KDocTest() {
P(listOf(Text("Quote")))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -941,7 +942,7 @@ class ParserTest : KDocTest() {
Text(" Sample text")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -982,7 +983,7 @@ class ParserTest : KDocTest() {
mapOf("lang" to "kotlin")
),
P(listOf(Text("Sample text")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1009,7 +1010,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1035,7 +1036,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1063,7 +1064,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1091,7 +1092,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1121,7 +1122,7 @@ class ParserTest : KDocTest() {
Text(".")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1151,7 +1152,7 @@ class ParserTest : KDocTest() {
Text(" and sometimes example.com (but not on Github, for example).")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1240,7 +1241,7 @@ class ParserTest : KDocTest() {
)
),
P(listOf(Text("Some text to show that the reference links can follow later.")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1261,7 +1262,7 @@ class ParserTest : KDocTest() {
Text("text text")
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1288,7 +1289,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1315,7 +1316,7 @@ class ParserTest : KDocTest() {
A(listOf(Text("link to Google!")), mapOf("href" to "http://google.com"))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1348,7 +1349,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1413,7 +1414,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1437,7 +1438,7 @@ class ParserTest : KDocTest() {
Strikethrough(listOf(Text("strikethroughed")))
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1464,7 +1465,7 @@ class ParserTest : KDocTest() {
)
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1514,7 +1515,7 @@ class ParserTest : KDocTest() {
)
)
),
- name = MarkdownElementTypes.MARKDOWN_FILE.name
+ name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
@@ -1537,7 +1538,7 @@ class ParserTest : KDocTest() {
CodeInline(listOf(Text("``` "))),
)
)
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
+ ), name = MARKDOWN_ELEMENT_FILE_NAME
)
)
)
diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt
index 920dea10..6a3e80cd 100644
--- a/plugins/base/src/test/kotlin/model/ClassesTest.kt
+++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt
@@ -1,6 +1,7 @@
package model
import org.jetbrains.dokka.links.DRI
+import org.jetbrains.dokka.links.TypeConstructor
import org.jetbrains.dokka.links.sureClassNames
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.KotlinModifier.*
@@ -10,7 +11,6 @@ import utils.AbstractModelTest
import utils.assertNotNull
import utils.name
import utils.supers
-import org.jetbrains.dokka.links.TypeConstructor
class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "classes") {
diff --git a/plugins/base/src/test/kotlin/model/CommentTest.kt b/plugins/base/src/test/kotlin/model/CommentTest.kt
index 7f2151bc..cd149209 100644
--- a/plugins/base/src/test/kotlin/model/CommentTest.kt
+++ b/plugins/base/src/test/kotlin/model/CommentTest.kt
@@ -3,9 +3,11 @@ package model
import org.jetbrains.dokka.model.DClass
import org.jetbrains.dokka.model.DProperty
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.model.doc.Br
import org.junit.jupiter.api.Test
-import utils.*
+import utils.AbstractModelTest
+import utils.assertNotNull
+import utils.comments
+import utils.docs
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 f2657ef8..e28b442f 100644
--- a/plugins/base/src/test/kotlin/model/ExtensionsTest.kt
+++ b/plugins/base/src/test/kotlin/model/ExtensionsTest.kt
@@ -1,10 +1,13 @@
package model
import org.jetbrains.dokka.base.transformers.documentables.CallableExtensions
-import org.jetbrains.dokka.model.*
+import org.jetbrains.dokka.model.DClass
+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 org.jetbrains.dokka.model.properties.WithExtraProperties
class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "classes") {
private fun <T : WithExtraProperties<R>, R : Documentable> T.checkExtension(name: String = "extension") =
@@ -149,4 +152,4 @@ class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "cl
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt
index 265bb7a0..641f6ef5 100644
--- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt
+++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt
@@ -1,18 +1,12 @@
package model
import org.jetbrains.dokka.Platform
-import org.jetbrains.dokka.analysis.DokkaAnalysisConfiguration
-import org.jetbrains.dokka.analysis.ProjectKotlinAnalysis
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.transformers.documentables.InheritorsInfo
import org.jetbrains.dokka.model.DClass
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.jetbrains.dokka.plugability.DokkaPlugin
-import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
-import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import utils.AbstractModelTest
@@ -155,220 +149,221 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt",
}
}
- class IgnoreCommonBuiltInsPlugin : DokkaPlugin() {
- private val dokkaBase by lazy { plugin<DokkaBase>() }
- @Suppress("unused")
- val stdLibKotlinAnalysis by extending {
- dokkaBase.kotlinAnalysis providing { ctx ->
- ProjectKotlinAnalysis(
- sourceSets = ctx.configuration.sourceSets,
- logger = ctx.logger,
- analysisConfiguration = DokkaAnalysisConfiguration(ignoreCommonBuiltIns = true)
- )
- } override dokkaBase.defaultKotlinAnalysis
- }
-
- @OptIn(DokkaPluginApiPreview::class)
- override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement =
- PluginApiPreviewAcknowledgement
- }
- @Test
- fun `should inherit docs for stdLib #2638`() {
- val testConfiguration = dokkaConfiguration {
- suppressObviousFunctions = false
- sourceSets {
- sourceSet {
- sourceRoots = listOf("src/")
- analysisPlatform = "common"
- languageVersion = "1.4"
- }
- }
- }
-
- inlineModelTest(
- """
- package kotlin.collections
-
- import kotlin.internal.PlatformDependent
-
- /**
- * Classes that inherit from this interface can be represented as a sequence of elements that can
- * be iterated over.
- * @param T the type of element being iterated over. The iterator is covariant in its element type.
- */
- public interface Iterable<out T> {
- /**
- * Returns an iterator over the elements of this object.
- */
- public operator fun iterator(): Iterator<T>
- }
-
- /**
- * Classes that inherit from this interface can be represented as a sequence of elements that can
- * be iterated over and that supports removing elements during iteration.
- * @param T the type of element being iterated over. The mutable iterator is invariant in its element type.
- */
- public interface MutableIterable<out T> : Iterable<T> {
- /**
- * Returns an iterator over the elements of this sequence that supports removing elements during iteration.
- */
- override fun iterator(): MutableIterator<T>
- }
-
- /**
- * A generic collection of elements. Methods in this interface support only read-only access to the collection;
- * read/write access is supported through the [MutableCollection] interface.
- * @param E the type of elements contained in the collection. The collection is covariant in its element type.
- */
- public interface Collection<out E> : Iterable<E> {
- // Query Operations
- /**
- * Returns the size of the collection.
- */
- public val size: Int
-
- /**
- * Returns `true` if the collection is empty (contains no elements), `false` otherwise.
- */
- public fun isEmpty(): Boolean
-
- /**
- * Checks if the specified element is contained in this collection.
- */
- public operator fun contains(element: @UnsafeVariance E): Boolean
-
- override fun iterator(): Iterator<E>
-
- // Bulk Operations
- /**
- * Checks if all elements in the specified collection are contained in this collection.
- */
- public fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean
- }
-
- /**
- * A generic collection of elements that supports adding and removing elements.
- *
- * @param E the type of elements contained in the collection. The mutable collection is invariant in its element type.
- */
- public interface MutableCollection<E> : Collection<E>, MutableIterable<E> {
- // Query Operations
- override fun iterator(): MutableIterator<E>
-
- // Modification Operations
- /**
- * Adds the specified element to the collection.
- *
- * @return `true` if the element has been added, `false` if the collection does not support duplicates
- * and the element is already contained in the collection.
- */
- public fun add(element: E): Boolean
-
- /**
- * Removes a single instance of the specified element from this
- * collection, if it is present.
- *
- * @return `true` if the element has been successfully removed; `false` if it was not present in the collection.
- */
- public fun remove(element: E): Boolean
-
- // Bulk Modification Operations
- /**
- * Adds all of the elements of the specified collection to this collection.
- *
- * @return `true` if any of the specified elements was added to the collection, `false` if the collection was not modified.
- */
- public fun addAll(elements: Collection<E>): Boolean
-
- /**
- * Removes all of this collection's elements that are also contained in the specified collection.
- *
- * @return `true` if any of the specified elements was removed from the collection, `false` if the collection was not modified.
- */
- public fun removeAll(elements: Collection<E>): Boolean
-
- /**
- * Retains only the elements in this collection that are contained in the specified collection.
- *
- * @return `true` if any element was removed from the collection, `false` if the collection was not modified.
- */
- public fun retainAll(elements: Collection<E>): Boolean
-
- /**
- * Removes all elements from this collection.
- */
- public fun clear(): Unit
- }
-
- /**
- * A generic ordered collection of elements. Methods in this interface support only read-only access to the list;
- * read/write access is supported through the [MutableList] interface.
- * @param E the type of elements contained in the list. The list is covariant in its element type.
- */
- public interface List<out E> : Collection<E> {
- // Query Operations
-
- override val size: Int
- override fun isEmpty(): Boolean
- override fun contains(element: @UnsafeVariance E): Boolean
- override fun iterator(): Iterator<E>
-
- // Bulk Operations
- override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean
-
- // Positional Access Operations
- /**
- * Returns the element at the specified index in the list.
- */
- public operator fun get(index: Int): E
-
- // Search Operations
- /**
- * Returns the index of the first occurrence of the specified element in the list, or -1 if the specified
- * element is not contained in the list.
- */
- public fun indexOf(element: @UnsafeVariance E): Int
-
- /**
- * Returns the index of the last occurrence of the specified element in the list, or -1 if the specified
- * element is not contained in the list.
- */
- public fun lastIndexOf(element: @UnsafeVariance E): Int
-
- // List Iterators
- /**
- * Returns a list iterator over the elements in this list (in proper sequence).
- */
- public fun listIterator(): ListIterator<E>
-
- /**
- * Returns a list iterator over the elements in this list (in proper sequence), starting at the specified [index].
- */
- public fun listIterator(index: Int): ListIterator<E>
-
- // View
- /**
- * Returns a view of the portion of this list between the specified [fromIndex] (inclusive) and [toIndex] (exclusive).
- * The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.
- *
- * Structural changes in the base list make the behavior of the view undefined.
- */
- public fun subList(fromIndex: Int, toIndex: Int): List<E>
- }
-
- // etc
- """.trimMargin(),
- platform = Platform.common.toString(),
- configuration = testConfiguration,
- prependPackage = false,
- pluginsOverrides = listOf(IgnoreCommonBuiltInsPlugin())
- ) {
- with((this / "kotlin.collections" / "List" / "contains").cast<DFunction>()) {
- documentation.size equals 1
-
- }
- }
- }
+// TODO [beresnev] fix, needs access to analysis
+// class IgnoreCommonBuiltInsPlugin : DokkaPlugin() {
+// private val kotlinAnalysisPlugin by lazy { plugin<DescriptorKotlinAnalysisPlugin>() }
+// @Suppress("unused")
+// val stdLibKotlinAnalysis by extending {
+// kotlinAnalysisPlugin.kotlinAnalysis providing { ctx ->
+// ProjectKotlinAnalysis(
+// sourceSets = ctx.configuration.sourceSets,
+// logger = ctx.logger,
+// analysisConfiguration = DokkaAnalysisConfiguration(ignoreCommonBuiltIns = true)
+// )
+// } override kotlinAnalysisPlugin.defaultKotlinAnalysis
+// }
+//
+// @OptIn(DokkaPluginApiPreview::class)
+// override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement =
+// PluginApiPreviewAcknowledgement
+// }
+// @Test
+// fun `should inherit docs for stdLib #2638`() {
+// val testConfiguration = dokkaConfiguration {
+// suppressObviousFunctions = false
+// sourceSets {
+// sourceSet {
+// sourceRoots = listOf("src/")
+// analysisPlatform = "common"
+// languageVersion = "1.4"
+// }
+// }
+// }
+//
+// inlineModelTest(
+// """
+// package kotlin.collections
+//
+// import kotlin.internal.PlatformDependent
+//
+// /**
+// * Classes that inherit from this interface can be represented as a sequence of elements that can
+// * be iterated over.
+// * @param T the type of element being iterated over. The iterator is covariant in its element type.
+// */
+// public interface Iterable<out T> {
+// /**
+// * Returns an iterator over the elements of this object.
+// */
+// public operator fun iterator(): Iterator<T>
+// }
+//
+// /**
+// * Classes that inherit from this interface can be represented as a sequence of elements that can
+// * be iterated over and that supports removing elements during iteration.
+// * @param T the type of element being iterated over. The mutable iterator is invariant in its element type.
+// */
+// public interface MutableIterable<out T> : Iterable<T> {
+// /**
+// * Returns an iterator over the elements of this sequence that supports removing elements during iteration.
+// */
+// override fun iterator(): MutableIterator<T>
+// }
+//
+// /**
+// * A generic collection of elements. Methods in this interface support only read-only access to the collection;
+// * read/write access is supported through the [MutableCollection] interface.
+// * @param E the type of elements contained in the collection. The collection is covariant in its element type.
+// */
+// public interface Collection<out E> : Iterable<E> {
+// // Query Operations
+// /**
+// * Returns the size of the collection.
+// */
+// public val size: Int
+//
+// /**
+// * Returns `true` if the collection is empty (contains no elements), `false` otherwise.
+// */
+// public fun isEmpty(): Boolean
+//
+// /**
+// * Checks if the specified element is contained in this collection.
+// */
+// public operator fun contains(element: @UnsafeVariance E): Boolean
+//
+// override fun iterator(): Iterator<E>
+//
+// // Bulk Operations
+// /**
+// * Checks if all elements in the specified collection are contained in this collection.
+// */
+// public fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean
+// }
+//
+// /**
+// * A generic collection of elements that supports adding and removing elements.
+// *
+// * @param E the type of elements contained in the collection. The mutable collection is invariant in its element type.
+// */
+// public interface MutableCollection<E> : Collection<E>, MutableIterable<E> {
+// // Query Operations
+// override fun iterator(): MutableIterator<E>
+//
+// // Modification Operations
+// /**
+// * Adds the specified element to the collection.
+// *
+// * @return `true` if the element has been added, `false` if the collection does not support duplicates
+// * and the element is already contained in the collection.
+// */
+// public fun add(element: E): Boolean
+//
+// /**
+// * Removes a single instance of the specified element from this
+// * collection, if it is present.
+// *
+// * @return `true` if the element has been successfully removed; `false` if it was not present in the collection.
+// */
+// public fun remove(element: E): Boolean
+//
+// // Bulk Modification Operations
+// /**
+// * Adds all of the elements of the specified collection to this collection.
+// *
+// * @return `true` if any of the specified elements was added to the collection, `false` if the collection was not modified.
+// */
+// public fun addAll(elements: Collection<E>): Boolean
+//
+// /**
+// * Removes all of this collection's elements that are also contained in the specified collection.
+// *
+// * @return `true` if any of the specified elements was removed from the collection, `false` if the collection was not modified.
+// */
+// public fun removeAll(elements: Collection<E>): Boolean
+//
+// /**
+// * Retains only the elements in this collection that are contained in the specified collection.
+// *
+// * @return `true` if any element was removed from the collection, `false` if the collection was not modified.
+// */
+// public fun retainAll(elements: Collection<E>): Boolean
+//
+// /**
+// * Removes all elements from this collection.
+// */
+// public fun clear(): Unit
+// }
+//
+// /**
+// * A generic ordered collection of elements. Methods in this interface support only read-only access to the list;
+// * read/write access is supported through the [MutableList] interface.
+// * @param E the type of elements contained in the list. The list is covariant in its element type.
+// */
+// public interface List<out E> : Collection<E> {
+// // Query Operations
+//
+// override val size: Int
+// override fun isEmpty(): Boolean
+// override fun contains(element: @UnsafeVariance E): Boolean
+// override fun iterator(): Iterator<E>
+//
+// // Bulk Operations
+// override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean
+//
+// // Positional Access Operations
+// /**
+// * Returns the element at the specified index in the list.
+// */
+// public operator fun get(index: Int): E
+//
+// // Search Operations
+// /**
+// * Returns the index of the first occurrence of the specified element in the list, or -1 if the specified
+// * element is not contained in the list.
+// */
+// public fun indexOf(element: @UnsafeVariance E): Int
+//
+// /**
+// * Returns the index of the last occurrence of the specified element in the list, or -1 if the specified
+// * element is not contained in the list.
+// */
+// public fun lastIndexOf(element: @UnsafeVariance E): Int
+//
+// // List Iterators
+// /**
+// * Returns a list iterator over the elements in this list (in proper sequence).
+// */
+// public fun listIterator(): ListIterator<E>
+//
+// /**
+// * Returns a list iterator over the elements in this list (in proper sequence), starting at the specified [index].
+// */
+// public fun listIterator(index: Int): ListIterator<E>
+//
+// // View
+// /**
+// * Returns a view of the portion of this list between the specified [fromIndex] (inclusive) and [toIndex] (exclusive).
+// * The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.
+// *
+// * Structural changes in the base list make the behavior of the view undefined.
+// */
+// public fun subList(fromIndex: Int, toIndex: Int): List<E>
+// }
+//
+// // etc
+// """.trimMargin(),
+// platform = Platform.common.toString(),
+// configuration = testConfiguration,
+// prependPackage = false,
+// pluginsOverrides = listOf(IgnoreCommonBuiltInsPlugin())
+// ) {
+// with((this / "kotlin.collections" / "List" / "contains").cast<DFunction>()) {
+// documentation.size equals 1
+//
+// }
+// }
+// }
@Test
fun `should inherit docs in case of diamond inheritance`() {
diff --git a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt
index a163f7f4..5fe17fc8 100644
--- a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt
+++ b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt
@@ -3,13 +3,10 @@ package model
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.childrenOfType
import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.model.firstMemberOfType
import org.jetbrains.dokka.model.withDescendants
-import org.jetbrains.dokka.pages.ContentText
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
+import org.jetbrains.dokka.utilities.firstIsInstanceOrNull
import org.junit.jupiter.api.Test
import translators.documentationOf
import utils.docs
@@ -361,4 +358,4 @@ class MultiLanguageInheritanceTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt
index 1047d6cf..d38667bf 100644
--- a/plugins/base/src/test/kotlin/model/PropertyTest.kt
+++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt
@@ -1,13 +1,10 @@
package model
-import org.jetbrains.dokka.links.Callable
-import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.*
import org.junit.jupiter.api.Test
import utils.AbstractModelTest
import utils.assertNotNull
import utils.name
-import kotlin.test.assertEquals
class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "property") {
diff --git a/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/plugins/base/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt
index 1a1340dc..1e4869f8 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 org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
class BasicMultiplatformTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt
index 6e85fe01..13431bd2 100644
--- a/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt
+++ b/plugins/base/src/test/kotlin/pageMerger/PageNodeMergerTest.kt
@@ -1,14 +1,13 @@
package pageMerger
-import org.junit.jupiter.api.Assertions.assertTrue
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Test
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 java.lang.IllegalArgumentException
+import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
class PageNodeMergerTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
index cf1332db..f4615216 100644
--- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
+++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
@@ -1,21 +1,18 @@
package parsers
-import com.jetbrains.rd.util.first
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.base.translators.psi.parsers.*
import org.jetbrains.dokka.links.Callable
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.JavaClassReference
import org.jetbrains.dokka.model.DEnum
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
+import org.jetbrains.dokka.utilities.firstIsInstanceOrNull
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import utils.docs
import utils.text
-import kotlin.random.*
-import kotlin.test.*
+import kotlin.test.assertNotNull
class JavadocParserTest : BaseAbstractTest() {
@@ -98,7 +95,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -136,7 +133,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -171,7 +168,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -208,7 +205,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -242,7 +239,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -359,7 +356,7 @@ class JavadocParserTest : BaseAbstractTest() {
testInline(source, configuration) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
assertEquals(expected, docs.children.first().root.children)
}
}
@@ -384,7 +381,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -428,7 +425,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -462,7 +459,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
assertEquals(
@@ -578,7 +575,7 @@ class JavadocParserTest : BaseAbstractTest() {
configuration,
) {
documentablesCreationStage = { modules ->
- val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ val docs = modules.first().packages.first().classlikes.single().documentation.values.first()
val root = docs.children.first().root
kotlin.test.assertEquals(
@@ -591,26 +588,27 @@ class JavadocParserTest : BaseAbstractTest() {
}
}
- @Test
- fun `test isolated parsing is case sensitive`() {
- // Ensure that it won't accidentally break
- val values = JavadocTag.values().map { it.toString().toLowerCase() }
- val withRandomizedCapitalization = values.map {
- val result = buildString {
- for (char in it) {
- if (Random.nextBoolean()) {
- append(char)
- } else {
- append(char.toLowerCase())
- }
- }
- }
- if (result == it) result.toUpperCase() else result
- }
-
- for ((index, value) in JavadocTag.values().withIndex()) {
- assertEquals(value, JavadocTag.lowercaseValueOfOrNull(values[index]))
- assertNull(JavadocTag.lowercaseValueOfOrNull(withRandomizedCapitalization[index]))
- }
- }
+ // TODO [beresnev] move to java-analysis
+// @Test
+// fun `test isolated parsing is case sensitive`() {
+// // Ensure that it won't accidentally break
+// val values = JavadocTag.values().map { it.toString().toLowerCase() }
+// val withRandomizedCapitalization = values.map {
+// val result = buildString {
+// for (char in it) {
+// if (Random.nextBoolean()) {
+// append(char)
+// } else {
+// append(char.toLowerCase())
+// }
+// }
+// }
+// if (result == it) result.toUpperCase() else result
+// }
+//
+// for ((index, value) in JavadocTag.values().withIndex()) {
+// assertEquals(value, JavadocTag.lowercaseValueOfOrNull(values[index]))
+// assertNull(JavadocTag.lowercaseValueOfOrNull(withRandomizedCapitalization[index]))
+// }
+// }
}
diff --git a/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt b/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt
deleted file mode 100644
index b6f9307f..00000000
--- a/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt
+++ /dev/null
@@ -1,282 +0,0 @@
-package parsers
-
-import org.intellij.markdown.MarkdownElementTypes
-import org.jetbrains.dokka.base.parsers.moduleAndPackage.*
-import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.Module
-import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.Package
-import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.utilities.DokkaLogger
-import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Assertions.assertTrue
-import org.junit.jupiter.api.Test
-import org.junit.jupiter.api.assertThrows
-import org.junit.jupiter.api.io.TempDir
-import java.nio.file.Path
-
-class ParseModuleAndPackageDocumentationFragmentsTest {
-
- private fun testBasicExample(lineSeperator: String = "\n") {
- val source = source(
- """
- # Module kotlin-demo
- Module description
-
- # Package org.jetbrains.kotlin.demo
- Package demo description
- ## Level 2 heading
- Heading 2\r\n
-
- # Package org.jetbrains.kotlin.demo2
- Package demo2 description
- """.trimIndent().replace("\n", lineSeperator)
- )
- val fragments = parseModuleAndPackageDocumentationFragments(source)
-
- assertEquals(
- listOf(
- ModuleAndPackageDocumentationFragment(
- classifier = Module,
- name = "kotlin-demo",
- documentation = "Module description",
- source = source
- ),
- ModuleAndPackageDocumentationFragment(
- classifier = Package,
- name = "org.jetbrains.kotlin.demo",
- documentation = "Package demo description${lineSeperator}## Level 2 heading${lineSeperator}Heading 2\\r\\n",
- source = source
- ),
- ModuleAndPackageDocumentationFragment(
- classifier = Package,
- name = "org.jetbrains.kotlin.demo2",
- documentation = "Package demo2 description",
- source = source
- )
- ),
- fragments
- )
- }
-
- @Test
- fun `basic example`() {
- testBasicExample()
- }
-
- @Test
- fun `CRLF line seperators`() {
- testBasicExample("\r\n")
- }
-
- @Test
- fun `no module name specified fails`() {
- val exception = assertThrows<IllegalModuleAndPackageDocumentation> {
- parseModuleAndPackageDocumentationFragments(
- source(
- """
- # Module
- No module name given
- """.trimIndent()
- )
- )
- }
-
- assertTrue(
- "Missing Module name" in exception.message.orEmpty(),
- "Expected 'Missing Module name' in error message"
- )
- }
-
- @Test
- fun `no package name specified does not fail`() {
- val source = source(
- """
- # Package
- This is a root package
- """.trimIndent()
- )
- val fragments = parseModuleAndPackageDocumentationFragments(source)
- assertEquals(1, fragments.size, "Expected a single package fragment")
-
- assertEquals(
- ModuleAndPackageDocumentationFragment(
- name = "",
- classifier = Package,
- documentation = "This is a root package",
- source = source
- ),
- fragments.single()
- )
- }
-
- @Test
- fun `white space in module name is supported`() {
- val fragment = parseModuleAndPackageDocumentationFragments(
- source(
- """
- # Module My Module
- Documentation for my module
- """.trimIndent()
- )
- )
-
- assertEquals(
- Module, fragment.single().classifier,
- "Expected module being parsec"
- )
-
- assertEquals(
- "My Module", fragment.single().name,
- "Expected module name with white spaces being parsed"
- )
-
- assertEquals(
- "Documentation for my module", fragment.single().documentation,
- "Expected documentation being available"
- )
- }
-
- @Test
- fun `white space in package name fails`() {
- val exception = assertThrows<IllegalModuleAndPackageDocumentation> {
- parseModuleAndPackageDocumentationFragments(
- source(
- """
- # Package my package
- """.trimIndent()
- )
- )
- }
-
- assertTrue(
- "Package my package" in exception.message.orEmpty(),
- "Expected problematic statement in error message"
- )
- }
-
- @Test
- fun `multiple whitespaces are supported in first line`() {
- val source = source(
- """
- # Module my-module
- My Module
- # Package com.my.package
- My Package
- """.trimIndent()
- )
- val fragments = parseModuleAndPackageDocumentationFragments(source)
-
- assertEquals(
- listOf(
- ModuleAndPackageDocumentationFragment(
- classifier = Module,
- name = "my-module",
- documentation = "My Module",
- source = source
- ),
- ModuleAndPackageDocumentationFragment(
- classifier = Package,
- name = "com.my.package",
- documentation = "My Package",
- source = source
- )
- ),
- fragments
- )
- }
-
- @Test
- fun `parse from file`(@TempDir temporaryFolder: Path) {
- val file = temporaryFolder.resolve("other.md").toFile()
- file.writeText(
- """
- # Module MyModule
- D1
- # Package com.sample
- D2
- """.trimIndent()
- )
-
- assertEquals(
- listOf(
- ModuleAndPackageDocumentationFragment(
- classifier = Module,
- name = "MyModule",
- documentation = "D1",
- source = ModuleAndPackageDocumentationFile(file)
- ),
- ModuleAndPackageDocumentationFragment(
- classifier = Package,
- name = "com.sample",
- documentation = "D2",
- source = ModuleAndPackageDocumentationFile(file)
- )
- ),
- parseModuleAndPackageDocumentationFragments(file)
- )
- }
-
- @Test
- fun `at in code block is supported`() {
- val fragment = parseModuleAndPackageDocumentationFragments(
- source(
- """
- # Module My Module
- ```
- @Smth
- ```
- @author Smb
- """.trimIndent()
- )
- )
-
- assertEquals(
- "```\n" +
- "@Smth\n" +
- "```\n" +
- "@author Smb", fragment.single().documentation,
- "Expected documentation being available"
- )
-
- val parsingContext = ModuleAndPackageDocumentationParsingContext(object : DokkaLogger {
- override var warningsCount: Int = 0
- override var errorsCount: Int = 0
- override fun debug(message: String) {}
- override fun info(message: String) {}
- override fun progress(message: String) {}
- override fun warn(message: String) {}
- override fun error(message: String) {}
- })
- val parsedFragment = parseModuleAndPackageDocumentation(parsingContext, fragment.single())
- val expectedDocumentationNode = DocumentationNode(
- listOf(
- Description(
- CustomDocTag(
- listOf(
- CodeBlock(
- listOf(
- Text("@Smth")
- )
- )
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
- )
- ),
- Author(
- CustomDocTag(
- listOf(
- P(listOf(Text("Smb")))
- ), name = MarkdownElementTypes.MARKDOWN_FILE.name
- )
- )
- )
- )
- assertEquals(
- expectedDocumentationNode, parsedFragment.documentation
- )
- }
-
- private fun source(documentation: String): ModuleAndPackageDocumentationSource =
- object : ModuleAndPackageDocumentationSource() {
- override val sourceDescription: String = "inline test"
- override val documentation: String = documentation
- }
-}
diff --git a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
index 244163ec..f69cf80f 100644
--- a/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/GroupWrappingTest.kt
@@ -3,7 +3,7 @@ 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.*
+import renderers.testPage
import utils.Div
import utils.P
import utils.match
diff --git a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt
index 56329940..7afc978c 100644
--- a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt
@@ -10,11 +10,9 @@ import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProviderFactory
import org.jetbrains.dokka.testApi.context.MockContext
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
-import org.jsoup.nodes.Node
-import org.jsoup.nodes.TextNode
import renderers.RenderingOnlyTestBase
-import utils.TestOutputWriter
import testApi.testRunner.defaultSourceSet
+import utils.TestOutputWriter
import java.io.File
abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase<Element>() {
diff --git a/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt b/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt
index e83f70d5..5e2560bf 100644
--- a/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt
@@ -3,9 +3,9 @@ package renderers.html
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Test
import utils.TestOutputWriterPlugin
-import kotlin.test.assertEquals
import utils.navigationHtml
import utils.selectNavigationGrid
+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 21b4ea3c..75993e49 100644
--- a/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/NavigationTest.kt
@@ -5,8 +5,8 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jsoup.nodes.Element
import org.junit.jupiter.api.Test
import utils.TestOutputWriterPlugin
-import kotlin.test.assertEquals
import utils.navigationHtml
+import kotlin.test.assertEquals
import kotlin.test.assertNull
class NavigationTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt
index edb5089d..c9787b67 100644
--- a/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt
+++ b/plugins/base/src/test/kotlin/signatures/FunctionalTypeConstructorsSignatureTest.kt
@@ -1,15 +1,14 @@
package signatures
import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.jdk
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.A
import utils.Span
import utils.TestOutputWriterPlugin
import utils.match
-import java.lang.IllegalStateException
class FunctionalTypeConstructorsSignatureTest : BaseAbstractTest() {
private val configuration = dokkaConfiguration {
diff --git a/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt b/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt
index 5a6d95eb..2837e891 100644
--- a/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt
+++ b/plugins/base/src/test/kotlin/signatures/ObviousTypeSkippingTest.kt
@@ -2,10 +2,10 @@ package signatures
import matchers.content.assertNode
import matchers.content.hasExactText
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.firstMemberOfType
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.testApi.logger.TestLogger
-import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.utilities.DokkaConsoleLogger
import org.jetbrains.dokka.utilities.LoggingLevel
import org.junit.jupiter.params.ParameterizedTest
diff --git a/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt
index b82b673c..06a3daae 100644
--- a/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt
+++ b/plugins/base/src/test/kotlin/signatures/VarianceSignatureTest.kt
@@ -3,7 +3,6 @@ package signatures
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.junit.jupiter.api.Test
import utils.A
-import utils.Span
import utils.TestOutputWriterPlugin
import utils.match
diff --git a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
index 5b97f969..30fc127f 100644
--- a/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
+++ b/plugins/base/src/test/kotlin/transformerBuilders/PageTransformerBuilderTest.kt
@@ -1,10 +1,10 @@
package transformerBuilders
import org.jetbrains.dokka.CoreExtensions
-import org.jetbrains.dokka.pages.*
-import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.dfs
+import org.jetbrains.dokka.pages.*
+import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement
import org.jetbrains.dokka.transformers.pages.PageTransformer
@@ -16,6 +16,7 @@ import org.junit.jupiter.api.Test
import utils.TestOutputWriterPlugin
import utils.assertContains
import utils.assertNotNull
+
class PageTransformerBuilderTest : BaseAbstractTest() {
class ProxyPlugin(transformer: PageTransformer) : DokkaPlugin() {
diff --git a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
index 07dc0bc7..e1029856 100644
--- a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
@@ -5,7 +5,6 @@ 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.jetbrains.kotlin.utils.addToStdlib.assertedCast
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
@@ -335,7 +334,7 @@ class CommentsToContentConverterTest {
+"I'm an inline-style link"
check {
assertEquals(
- assertedCast<ContentResolvedLink> { "Link should be resolved" }.address,
+ (this as? ContentResolvedLink)?.address ?: error("Link should be resolved"),
"https://www.google.com"
)
}
diff --git a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
index 8ed34b2a..fcdee619 100644
--- a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
+++ b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest1.kt
@@ -1,13 +1,15 @@
package transformers
import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
-import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationReader
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.doc.DocumentationNode
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.plugability.plugin
+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.kotlin.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
@@ -81,11 +83,11 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
)
}
- private val reader by lazy { ModuleAndPackageDocumentationReader(context) }
+ private val reader by lazy { context.plugin<InternalKotlinAnalysisPlugin>().querySingle { moduleAndPackageDocumentationReader } }
@Test
fun `assert moduleA with sourceSetA`() {
- val documentation = reader[dModule(name = "moduleA", sourceSets = setOf(sourceSetA))]
+ val documentation = reader.read(dModule(name = "moduleA", sourceSets = setOf(sourceSetA)))
assertEquals(
1, documentation.keys.size,
"Expected moduleA only containing documentation in a single source set"
@@ -103,7 +105,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert moduleA with no source sets`() {
- val documentation = reader[dModule("moduleA")]
+ val documentation = reader.read(dModule("moduleA"))
assertEquals(
emptyMap<DokkaSourceSet, DocumentationNode>(), documentation,
"Expected no documentation received for module not declaring a matching sourceSet"
@@ -115,15 +117,15 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
assertThrows<IllegalStateException>(
"Expected no documentation received for module with unknown sourceSet"
) {
- reader[
+ reader.read(
dModule("moduleA", sourceSets = setOf(configurationBuilder.unattachedSourceSet { name = "unknown" }))
- ]
+ )
}
}
@Test
fun `assert moduleA with all sourceSets`() {
- val documentation = reader[dModule("moduleA", sourceSets = setOf(sourceSetA, sourceSetB, sourceSetB2))]
+ val documentation = reader.read(dModule("moduleA", sourceSets = setOf(sourceSetA, sourceSetB, sourceSetB2)))
assertEquals(1, documentation.entries.size, "Expected only one entry from sourceSetA")
assertEquals(sourceSetA, documentation.keys.single(), "Expected only one entry from sourceSetA")
assertEquals("This is moduleA", documentation.texts.single())
@@ -131,7 +133,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert moduleB with sourceSetB and sourceSetB2`() {
- val documentation = reader[dModule("moduleB", sourceSets = setOf(sourceSetB, sourceSetB2))]
+ val documentation = reader.read(dModule("moduleB", sourceSets = setOf(sourceSetB, sourceSetB2)))
assertEquals(1, documentation.keys.size, "Expected only one entry from sourceSetB")
assertEquals(sourceSetB, documentation.keys.single(), "Expected only one entry from sourceSetB")
assertEquals("This is moduleB", documentation.texts.single())
@@ -139,7 +141,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert sample_A in sourceSetA`() {
- val documentation = reader[dPackage(DRI("sample.a"), sourceSets = setOf(sourceSetA))]
+ val documentation = reader.read(dPackage(DRI("sample.a"), sourceSets = setOf(sourceSetA)))
assertEquals(1, documentation.keys.size, "Expected only one entry from sourceSetA")
assertEquals(sourceSetA, documentation.keys.single(), "Expected only one entry from sourceSetA")
assertEquals("This is package sample.a\\r\\n", documentation.texts.single())
@@ -147,7 +149,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert sample_a_sub in sourceSetA`() {
- val documentation = reader[dPackage(DRI("sample.a.sub"), sourceSets = setOf(sourceSetA))]
+ val documentation = reader.read(dPackage(DRI("sample.a.sub"), sourceSets = setOf(sourceSetA)))
assertEquals(
emptyMap<DokkaSourceSet, DocumentationNode>(), documentation,
"Expected no documentation found for different package"
@@ -156,7 +158,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert sample_a in sourceSetB`() {
- val documentation = reader[dPackage(DRI("sample.a"), sourceSets = setOf(sourceSetB))]
+ val documentation = reader.read(dPackage(DRI("sample.a"), sourceSets = setOf(sourceSetB)))
assertEquals(
emptyMap<DokkaSourceSet, DocumentationNode>(), documentation,
"Expected no documentation found for different sourceSet"
@@ -165,7 +167,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert sample_b in sourceSetB`() {
- val documentation = reader[dPackage(DRI("sample.b"), sourceSets = setOf(sourceSetB))]
+ val documentation = reader.read(dPackage(DRI("sample.b"), sourceSets = setOf(sourceSetB)))
assertEquals(1, documentation.keys.size, "Expected only one entry from sourceSetB")
assertEquals(sourceSetB, documentation.keys.single(), "Expected only one entry from sourceSetB")
assertEquals("This is package sample.b", documentation.texts.single())
@@ -173,7 +175,7 @@ class ContextModuleAndPackageDocumentationReaderTest1 : AbstractContextModuleAnd
@Test
fun `assert sample_b in sourceSetB and sourceSetB2`() {
- val documentation = reader[dPackage(DRI("sample.b"), sourceSets = setOf(sourceSetB, sourceSetB2))]
+ val documentation = reader.read(dPackage(DRI("sample.b"), sourceSets = setOf(sourceSetB, sourceSetB2)))
assertEquals(1, documentation.keys.size, "Expected only one entry from sourceSetB")
assertEquals(sourceSetB, documentation.keys.single(), "Expected only one entry from sourceSetB")
assertEquals("This is package sample.b", documentation.texts.single())
diff --git a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt
index 609f808d..4a8a81f2 100644
--- a/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt
+++ b/plugins/base/src/test/kotlin/transformers/ContextModuleAndPackageDocumentationReaderTest3.kt
@@ -1,10 +1,12 @@
package transformers
-import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationReader
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.kotlin.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import testApi.testRunner.TestDokkaConfigurationBuilder
@@ -42,12 +44,12 @@ class ContextModuleAndPackageDocumentationReaderTest3 : AbstractContextModuleAnd
)
}
- private val reader by lazy { ModuleAndPackageDocumentationReader(context) }
+ private val reader by lazy { context.plugin<InternalKotlinAnalysisPlugin>().querySingle { moduleAndPackageDocumentationReader } }
@Test
fun `root package is matched by empty string and the root keyword`() {
- val documentation = reader[dPackage(DRI(""), sourceSets = setOf(sourceSet))]
+ val documentation = reader.read(dPackage(DRI(""), sourceSets = setOf(sourceSet)))
assertEquals(
listOf("This is the root package", "This is also the root package"), documentation.texts
)
diff --git a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt
index ef36d811..16798508 100644
--- a/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/DivisionSwitchTest.kt
@@ -3,13 +3,12 @@ package transformers
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.jetbrains.dokka.model.dfs
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.kotlin.utils.addIfNotNull
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
@@ -47,7 +46,7 @@ class DivisionSwitchTest : BaseAbstractTest() {
}
}
suppressObviousFunctions = false
- pluginsConfigurations.addIfNotNull(
+ pluginsConfigurations.add(
PluginConfigurationImpl(
DokkaBase::class.qualifiedName!!,
DokkaConfiguration.SerializationFormat.JSON,
@@ -120,4 +119,4 @@ class DivisionSwitchTest : BaseAbstractTest() {
assertEquals(1, inheritedProperties.children.size, "Incorrect number of inherited properties found")
}
}
-} \ 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 59c83b7d..59c29435 100644
--- a/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/InvalidContentModuleAndPackageDocumentationReaderTest.kt
@@ -1,9 +1,11 @@
package transformers
-import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationReader
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.kotlin.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import testApi.testRunner.TestDokkaConfigurationBuilder
@@ -65,14 +67,14 @@ class InvalidContentModuleAndPackageDocumentationReaderTest : AbstractContextMod
)
}
- private val readerA by lazy { ModuleAndPackageDocumentationReader(contextA) }
- private val readerB by lazy { ModuleAndPackageDocumentationReader(contextB) }
+ private val readerA by lazy { contextA.plugin<InternalKotlinAnalysisPlugin>().querySingle { moduleAndPackageDocumentationReader } }
+ private val readerB by lazy { contextB.plugin<InternalKotlinAnalysisPlugin>().querySingle { moduleAndPackageDocumentationReader } }
@Test
fun `parsing should fail with a message when documentation is in not proper format`() {
val exception =
- runCatching { readerA[dModule(name = "moduleA", sourceSets = setOf(sourceSetA))] }.exceptionOrNull()
+ runCatching { readerA.read(dModule(name = "moduleA", sourceSets = setOf(sourceSetA))) }.exceptionOrNull()
assertEquals(
"Unexpected classifier: \"Invalid\", expected either \"Module\" or \"Package\". \n" +
"For more information consult the specification: https://kotlinlang.org/docs/dokka-module-and-package-docs.html",
@@ -83,7 +85,7 @@ class InvalidContentModuleAndPackageDocumentationReaderTest : AbstractContextMod
@Test
fun `parsing should fail with a message where it encountered error and why`() {
val exception =
- runCatching { readerB[dModule(name = "moduleB", sourceSets = setOf(sourceSetB))] }.exceptionOrNull()?.message!!
+ runCatching { readerB.read(dModule(name = "moduleB", sourceSets = setOf(sourceSetB))) }.exceptionOrNull()?.message!!
//I don't want to assert whole message since it contains a path to a temporary folder
assertTrue(exception.contains("Wrong AST Tree. Header does not contain expected content in "))
diff --git a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
index 241fb481..39d725bb 100644
--- a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
@@ -8,7 +8,6 @@ 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.jetbrains.kotlin.utils.addIfNotNull
import org.junit.jupiter.api.Test
import utils.assertNotNull
import kotlin.test.assertEquals
@@ -39,7 +38,7 @@ class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
sourceRoots = listOf("src/jvmMain/kotlin/pageMerger/Test.kt")
}
}
- pluginsConfigurations.addIfNotNull(
+ pluginsConfigurations.add(
PluginConfigurationImpl(
DokkaBase::class.qualifiedName!!,
DokkaConfiguration.SerializationFormat.JSON,
@@ -387,4 +386,4 @@ class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt
index 9f934f3f..e773a4da 100644
--- a/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/ModuleAndPackageDocumentationTransformerUnitTest.kt
@@ -1,16 +1,21 @@
package transformers
-import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationReader
+
+import org.jetbrains.dokka.DokkaConfiguration
+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
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.model.DPackage
import org.jetbrains.dokka.model.SourceSetDependent
+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.kotlin.analysis.kotlin.internal.ModuleAndPackageDocumentationReader
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import testApi.testRunner.dPackage
-import testApi.testRunner.documentationNode
import testApi.testRunner.sourceSet
@@ -20,8 +25,9 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
fun `empty list of modules`() {
val transformer = ModuleAndPackageDocumentationTransformer(
object : ModuleAndPackageDocumentationReader {
- override fun get(module: DModule): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
- override fun get(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
+ override fun read(module: DModule): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
+ override fun read(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
+ override fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode = throw NotImplementedError()
}
)
@@ -34,13 +40,13 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
fun `single module documentation`() {
val transformer = ModuleAndPackageDocumentationTransformer(
object : ModuleAndPackageDocumentationReader {
- override fun get(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
- override fun get(module: DModule): SourceSetDependent<DocumentationNode> {
+ override fun read(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
+ override fun read(module: DModule): SourceSetDependent<DocumentationNode> {
return module.sourceSets.associateWith { sourceSet ->
documentationNode("doc" + sourceSet.displayName)
}
}
-
+ override fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode = throw NotImplementedError()
}
)
@@ -77,13 +83,14 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
fun `merges with already existing module documentation`() {
val transformer = ModuleAndPackageDocumentationTransformer(
object : ModuleAndPackageDocumentationReader {
- override fun get(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
- override fun get(module: DModule): SourceSetDependent<DocumentationNode> {
+ override fun read(pkg: DPackage): SourceSetDependent<DocumentationNode> = throw NotImplementedError()
+ override fun read(module: DModule): SourceSetDependent<DocumentationNode> {
/* Only add documentation for first source set */
return module.sourceSets.take(1).associateWith { sourceSet ->
documentationNode("doc" + sourceSet.displayName)
}
}
+ override fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode = throw NotImplementedError()
}
)
@@ -121,8 +128,8 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
fun `package documentation`() {
val transformer = ModuleAndPackageDocumentationTransformer(
object : ModuleAndPackageDocumentationReader {
- override fun get(module: DModule): SourceSetDependent<DocumentationNode> = emptyMap()
- override fun get(pkg: DPackage): SourceSetDependent<DocumentationNode> {
+ override fun read(module: DModule): SourceSetDependent<DocumentationNode> = emptyMap()
+ override fun read(pkg: DPackage): SourceSetDependent<DocumentationNode> {
/* Only attach documentation to packages with 'attach' */
if ("attach" !in pkg.dri.packageName.orEmpty()) return emptyMap()
/* Only attach documentation to two source sets */
@@ -130,6 +137,7 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
documentationNode("doc:${sourceSet.displayName}:${pkg.dri.packageName}")
}
}
+ override fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode = throw NotImplementedError()
}
)
@@ -239,4 +247,10 @@ class ModuleAndPackageDocumentationTransformerUnitTest {
)
}
+
+ private fun documentationNode(vararg texts: String): DocumentationNode {
+ return DocumentationNode(
+ texts.toList()
+ .map { Description(CustomDocTag(listOf(Text(it)), name = MARKDOWN_ELEMENT_FILE_NAME)) })
+ }
}
diff --git a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
index 13e90f42..431abef5 100644
--- a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
@@ -5,7 +5,7 @@ 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.*
+import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
diff --git a/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt
index 11996186..469c1a1e 100644
--- a/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/SourceLinkTransformerTest.kt
@@ -3,12 +3,12 @@ package transformers
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.TestOutputWriterPlugin
import java.net.URL
import kotlin.test.assertEquals
-import org.jsoup.nodes.Element
class SourceLinkTransformerTest : BaseAbstractTest() {
@@ -124,4 +124,4 @@ class SourceLinkTransformerTest : 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 73f043bc..a6060970 100644
--- a/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/SuppressedByConfigurationDocumentableFilterTransformerTest.kt
@@ -2,8 +2,8 @@ package transformers
import org.jetbrains.dokka.DokkaDefaults
import org.jetbrains.dokka.PackageOptionsImpl
-import org.jetbrains.dokka.links.DRI
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
diff --git a/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt b/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt
index aeea194f..dee4bf7a 100644
--- a/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt
+++ b/plugins/base/src/test/kotlin/translators/AccessorMethodNamingTest.kt
@@ -1,8 +1,9 @@
package translators
-import org.junit.jupiter.api.Assertions.*
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
/**
@@ -115,4 +116,4 @@ class AccessorMethodNamingTest : BaseAbstractTest() {
assertEquals(testsDone, properties.size)
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/translators/Bug1341.kt b/plugins/base/src/test/kotlin/translators/Bug1341.kt
index a4b93a7e..a8c9e342 100644
--- a/plugins/base/src/test/kotlin/translators/Bug1341.kt
+++ b/plugins/base/src/test/kotlin/translators/Bug1341.kt
@@ -1,7 +1,7 @@
package translators
-import org.jetbrains.dokka.links.DRI
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
diff --git a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt
index a940264a..a763cbd2 100644
--- a/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt
+++ b/plugins/base/src/test/kotlin/translators/DefaultPsiToDocumentableTranslatorTest.kt
@@ -1,7 +1,6 @@
package translators
import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.PointingToDeclaration
@@ -13,7 +12,6 @@ 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 utils.assertNotNull
class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() {
val configuration = dokkaConfiguration {
@@ -320,70 +318,71 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() {
}
}
- class OnlyPsiPlugin : DokkaPlugin() {
- private val dokkaBase by lazy { plugin<DokkaBase>() }
-
- @Suppress("unused")
- val psiOverrideDescriptorTranslator by extending {
- (dokkaBase.psiToDocumentableTranslator
- override dokkaBase.descriptorToDocumentableTranslator)
- }
-
- @OptIn(DokkaPluginApiPreview::class)
- override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement =
- PluginApiPreviewAcknowledgement
- }
-
- // for Kotlin classes from DefaultPsiToDocumentableTranslator
- @Test
- fun `should resolve ultralight class`() {
- val configurationWithNoJVM = dokkaConfiguration {
- sourceSets {
- sourceSet {
- sourceRoots = listOf("src/main/java")
- }
- }
- }
-
- testInline(
- """
- |/src/main/java/example/Test.kt
- |package example
- |
- |open class KotlinSubClass {
- | fun kotlinSubclassFunction(bar: String): String {
- | return "KotlinSubClass"
- | }
- |}
- |
- |/src/main/java/example/JavaLeafClass.java
- |package example;
- |
- |public class JavaLeafClass extends KotlinSubClass {
- | public String javaLeafClassFunction(String baz) {
- | return "JavaLeafClass";
- | }
- |}
- """.trimMargin(),
- configurationWithNoJVM,
- pluginOverrides = listOf(OnlyPsiPlugin()) // suppress a descriptor translator because of psi and descriptor translators work in parallel
- ) {
- documentablesMergingStage = { module ->
- val kotlinSubclassFunction =
- module.packages.single().classlikes.find { it.name == "JavaLeafClass" }?.functions?.find { it.name == "kotlinSubclassFunction" }
- .assertNotNull("kotlinSubclassFunction ")
-
- assertEquals(
- "String",
- (kotlinSubclassFunction.type as? TypeConstructor)?.dri?.classNames
- )
- assertEquals(
- "String",
- (kotlinSubclassFunction.parameters.firstOrNull()?.type as? TypeConstructor)?.dri?.classNames
- )
- }
- }
- }
+ // TODO [beresnev] fix
+// class OnlyPsiPlugin : DokkaPlugin() {
+// private val kotlinAnalysisPlugin by lazy { plugin<Kotlin>() }
+//
+// @Suppress("unused")
+// val psiOverrideDescriptorTranslator by extending {
+// (plugin<JavaAnalysisPlugin>().psiToDocumentableTranslator
+// override kotlinAnalysisPlugin.descriptorToDocumentableTranslator)
+// }
+//
+// @OptIn(DokkaPluginApiPreview::class)
+// override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement =
+// PluginApiPreviewAcknowledgement
+// }
+//
+// // for Kotlin classes from DefaultPsiToDocumentableTranslator
+// @Test
+// fun `should resolve ultralight class`() {
+// val configurationWithNoJVM = dokkaConfiguration {
+// sourceSets {
+// sourceSet {
+// sourceRoots = listOf("src/main/java")
+// }
+// }
+// }
+//
+// testInline(
+// """
+// |/src/main/java/example/Test.kt
+// |package example
+// |
+// |open class KotlinSubClass {
+// | fun kotlinSubclassFunction(bar: String): String {
+// | return "KotlinSubClass"
+// | }
+// |}
+// |
+// |/src/main/java/example/JavaLeafClass.java
+// |package example;
+// |
+// |public class JavaLeafClass extends KotlinSubClass {
+// | public String javaLeafClassFunction(String baz) {
+// | return "JavaLeafClass";
+// | }
+// |}
+// """.trimMargin(),
+// configurationWithNoJVM,
+// pluginOverrides = listOf(OnlyPsiPlugin()) // suppress a descriptor translator because of psi and descriptor translators work in parallel
+// ) {
+// documentablesMergingStage = { module ->
+// val kotlinSubclassFunction =
+// module.packages.single().classlikes.find { it.name == "JavaLeafClass" }?.functions?.find { it.name == "kotlinSubclassFunction" }
+// .assertNotNull("kotlinSubclassFunction ")
+//
+// assertEquals(
+// "String",
+// (kotlinSubclassFunction.type as? TypeConstructor)?.dri?.classNames
+// )
+// assertEquals(
+// "String",
+// (kotlinSubclassFunction.parameters.firstOrNull()?.type as? TypeConstructor)?.dri?.classNames
+// )
+// }
+// }
+// }
@Test
fun `should preserve regular functions that are named like getters, but are not getters`() {
@@ -822,12 +821,12 @@ class DefaultPsiToDocumentableTranslatorTest : BaseAbstractTest() {
configuration
) {
documentablesMergingStage = { module ->
- val kotlinEnum = module.packages.find { it.name == "test" }
+ val javaEnum = module.packages.find { it.name == "test" }
?.classlikes
?.single { it.name == "JavaEnum" }
- checkNotNull(kotlinEnum)
+ checkNotNull(javaEnum)
- val valueOfFunction = kotlinEnum.functions.single { it.name == "valueOf" }
+ val valueOfFunction = javaEnum.functions.single { it.name == "valueOf" }
val expectedDocumentation = DocumentationNode(listOf(
Description(
diff --git a/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt b/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt
index 011ae729..bc5c909f 100644
--- a/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt
+++ b/plugins/base/src/test/kotlin/translators/ExternalDocumentablesTest.kt
@@ -1,15 +1,13 @@
package translators
-import com.intellij.openapi.application.PathManager
-import kotlinx.coroutines.Job
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.dokka.base.translators.descriptors.ExternalDocumentablesProvider
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.kotlin.analysis.kotlin.internal.ExternalDocumentablesProvider
+import org.jetbrains.kotlin.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
@@ -36,7 +34,7 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
) {
lateinit var provider: ExternalDocumentablesProvider
pluginsSetupStage = {
- provider = it.plugin<DokkaBase>().querySingle { externalDocumentablesProvider }
+ provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
@@ -59,7 +57,10 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
@Test
fun `external documentable from dependency`() {
val coroutinesPath =
- PathManager.getResourceRoot(Job::class.java, "/kotlinx/coroutines/Job.class")
+ ClassLoader.getSystemResource("kotlinx/coroutines/Job.class")
+ ?.file
+ ?.replace("file:", "")
+ ?.replaceAfter(".jar", "")
val configuration = dokkaConfiguration {
sourceSets {
@@ -82,7 +83,7 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
) {
lateinit var provider: ExternalDocumentablesProvider
pluginsSetupStage = {
- provider = it.plugin<DokkaBase>().querySingle { externalDocumentablesProvider }
+ provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
@@ -124,7 +125,7 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
) {
lateinit var provider: ExternalDocumentablesProvider
pluginsSetupStage = {
- provider = it.plugin<DokkaBase>().querySingle { externalDocumentablesProvider }
+ provider = it.plugin<InternalKotlinAnalysisPlugin>().querySingle { externalDocumentablesProvider }
}
documentablesTransformationStage = { mod ->
val entry = mod.packages.single().classlikes.single().cast<DClass>().supertypes.entries.single()
@@ -136,4 +137,4 @@ class ExternalDocumentablesTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt
index d5d25dc7..7fc6b7fa 100644
--- a/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt
+++ b/plugins/base/src/test/kotlin/translators/JavadocInheritDocsTest.kt
@@ -1,11 +1,10 @@
package translators
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.junit.Ignore
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
@@ -306,4 +305,4 @@ class JavadocInheritDocsTest : BaseAbstractTest() {
}
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt
index 7510e541..ba0d95d5 100644
--- a/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt
+++ b/plugins/base/src/test/kotlin/translators/JavadocInheritedDocTagsTest.kt
@@ -1,11 +1,10 @@
package translators
+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.DModule
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
-import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.jetbrains.dokka.model.doc.Deprecated as DokkaDeprecatedTag
@@ -89,7 +88,7 @@ class JavadocInheritedDocTagsTest : BaseAbstractTest() {
fun `work with return`() {
performTagsTest { module ->
val function = module.findFunction("sample", "Subclass", "test")
- val renderedTag = function.documentation.values.first().children.firstIsInstance<Return>()
+ val renderedTag = function.documentation.values.first().children.filterIsInstance<Return>().first()
val expectedTag = Return(
CustomDocTag(
children = listOf(
@@ -155,7 +154,7 @@ class JavadocInheritedDocTagsTest : BaseAbstractTest() {
fun `work with deprecated`() {
performTagsTest { module ->
val function = module.findFunction("sample", "Subclass", "test")
- val renderedTag = function.documentation.values.first().children.firstIsInstance<DokkaDeprecatedTag>()
+ val renderedTag = function.documentation.values.first().children.filterIsInstance<DokkaDeprecatedTag>().first()
val expectedTag = DokkaDeprecatedTag(
CustomDocTag(
children = listOf(
@@ -175,7 +174,7 @@ class JavadocInheritedDocTagsTest : BaseAbstractTest() {
fun `work with see also`() {
performTagsTest { module ->
val function = module.findFunction("sample", "Subclass", "test")
- val renderedTag = function.documentation.values.first().children.firstIsInstance<See>()
+ val renderedTag = function.documentation.values.first().children.filterIsInstance<See>().first()
val expectedTag = See(
CustomDocTag(
children = listOf(
@@ -197,7 +196,7 @@ class JavadocInheritedDocTagsTest : BaseAbstractTest() {
fun `work with author`() {
performTagsTest { module ->
val classlike = module.findClasslike("sample", "Subclass")
- val renderedTag = classlike.documentation.values.first().children.firstIsInstance<Author>()
+ val renderedTag = classlike.documentation.values.first().children.filterIsInstance<Author>().first()
val expectedTag = Author(
CustomDocTag(
children = listOf(
@@ -246,4 +245,4 @@ class JavadocInheritedDocTagsTest : BaseAbstractTest() {
assertEquals(expectedXdTag, xdTag)
}
}
-} \ No newline at end of file
+}
diff --git a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
index 52902205..2c1173c0 100644
--- a/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
+++ b/plugins/base/src/test/kotlin/translators/JavadocParserTest.kt
@@ -1,14 +1,14 @@
package translators
+import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.DModule
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.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
-import org.junit.jupiter.api.Assertions.*
import utils.text
class JavadocParserTest : BaseAbstractTest() {
diff --git a/plugins/base/src/test/kotlin/translators/utils.kt b/plugins/base/src/test/kotlin/translators/utils.kt
index f0522ade..f9049ee5 100644
--- a/plugins/base/src/test/kotlin/translators/utils.kt
+++ b/plugins/base/src/test/kotlin/translators/utils.kt
@@ -3,7 +3,6 @@ package translators
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.doc.Description
import org.jetbrains.dokka.model.doc.Text
-import java.util.NoSuchElementException
fun DModule.documentationOf(className: String, functionName: String? = null): String =
descriptionOf(className, functionName)
diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt
index 4fce1155..d741c250 100644
--- a/plugins/base/src/test/kotlin/utils/contentUtils.kt
+++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt
@@ -1,7 +1,10 @@
package utils
import matchers.content.*
-import org.jetbrains.dokka.pages.*
+import org.jetbrains.dokka.pages.BasicTabbedContentType
+import org.jetbrains.dokka.pages.ContentGroup
+import org.jetbrains.dokka.pages.ContentPage
+import org.jetbrains.dokka.pages.RootPageNode
//TODO: Try to unify those functions after update to 1.4
fun ContentMatcherBuilder<*>.functionSignature(
@@ -328,4 +331,4 @@ data class ParamAttributes(
)
fun RootPageNode.findTestType(packageName: String, name: String) =
- children.single { it.name == packageName }.children.single { it.name == name } as ContentPage \ No newline at end of file
+ children.single { it.name == packageName }.children.single { it.name == name } as ContentPage