diff options
Diffstat (limited to 'plugins/base/src')
43 files changed, 197 insertions, 31 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index 9c443567..c70c1b0b 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -10,6 +10,7 @@ import org.jetbrains.dokka.pages.ClasslikePageNode import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.MemberPageNode import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Test class DRITest : BaseAbstractTest() { diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 46239baa..82159e0d 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -10,10 +10,7 @@ import org.jetbrains.dokka.pages.ContentText import org.jetbrains.dokka.pages.MemberPageNode import org.jetbrains.dokka.pages.PackagePageNode import org.junit.jupiter.api.Test -import utils.ParamAttributes -import utils.assertNotNull -import utils.bareSignature -import utils.propertySignature +import utils.* import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -318,6 +315,7 @@ class ContentForAnnotationsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `annotated bounds in Java`() { testInline( diff --git a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt index 961ce5f5..c25c1a1b 100644 --- a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt @@ -9,10 +9,12 @@ import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentStyle import org.junit.jupiter.api.Test +import utils.JavaCode import utils.pWrapped import kotlin.test.assertEquals import kotlin.test.assertTrue +@JavaCode class JavaDeprecatedTest : BaseAbstractTest() { private val testConfiguration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt index 14a36611..17bd209e 100644 --- a/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt +++ b/plugins/base/src/test/kotlin/content/exceptions/ContentForExceptions.kt @@ -7,9 +7,7 @@ import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.DisplaySourceSet import org.junit.jupiter.api.Test -import utils.ParamAttributes -import utils.bareSignature -import utils.findTestType +import utils.* import kotlin.test.assertEquals class ContentForExceptions : BaseAbstractTest() { @@ -55,6 +53,7 @@ class ContentForExceptions : BaseAbstractTest() { ) } + @OnlyDescriptors("Fixed in 1.9.20 (IMPORT STAR)") @Test fun `function with navigatable thrown exception`() { testInline( diff --git a/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt index e5059073..2994fb42 100644 --- a/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt +++ b/plugins/base/src/test/kotlin/content/inheritors/ContentForInheritorsTest.kt @@ -6,6 +6,7 @@ import org.jetbrains.dokka.PluginConfigurationImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.junit.jupiter.api.Test +import utils.OnlyDescriptors import utils.classSignature import utils.findTestType import kotlin.test.assertEquals @@ -128,6 +129,7 @@ class ContentForInheritorsTest : BaseAbstractTest() { } } + @OnlyDescriptors("Order of inheritors is different in K2") @Test fun `interface with few inheritors has table in description`() { testInline( diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt index e74cb49d..df5efd03 100644 --- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt +++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt @@ -242,6 +242,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `deprecated with multiple links inside`() { testInline( @@ -346,6 +347,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `deprecated with an multiple inline links`() { testInline( @@ -410,6 +412,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `multiline throws with comment`() { testInline( @@ -473,6 +476,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @OnlyDescriptors("Fixed in 1.9.20 (IMPORT STAR)") @Test fun `multiline kotlin throws with comment`() { testInline( @@ -590,6 +594,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `multiline throws where exception is not in the same line as description`() { testInline( @@ -673,6 +678,7 @@ class ContentForParamsTest : BaseAbstractTest() { } + @JavaCode @Test fun `documentation splitted in 2 using enters`() { testInline( @@ -718,6 +724,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `multiline return tag with param`() { testInline( @@ -783,6 +790,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @UsingJDK @Test fun `return tag in kotlin`() { testInline( @@ -830,6 +838,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `list with links and description`() { testInline( @@ -1476,6 +1485,7 @@ class ContentForParamsTest : BaseAbstractTest() { } } + @JavaCode @Test fun javaDocCommentWithDocumentedParameters() { testInline( diff --git a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt index 79c1e1ad..82a04b89 100644 --- a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt +++ b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt @@ -171,6 +171,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { } } + @OnlyDescriptors("No link for `abc` in K1") @Test fun `undocumented seealso with reference to parameter for class`() { testInline( @@ -201,7 +202,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { header(4) { +"See also" } table { group { - +"abc" + +"abc" // link { +"abc" } } } } @@ -751,6 +752,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { } } + @OnlyDescriptorsMPP @Test fun `multiplatform class with seealso in few platforms`() { testInline( diff --git a/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt index 0cf94c18..e57e6a8c 100644 --- a/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt +++ b/plugins/base/src/test/kotlin/content/signatures/ConstructorsSignaturesTest.kt @@ -5,6 +5,7 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.pages.BasicTabbedContentType import org.jetbrains.dokka.pages.ContentPage import org.junit.jupiter.api.Test +import utils.OnlyDescriptors class ConstructorsSignaturesTest : BaseAbstractTest() { private val testConfiguration = dokkaConfiguration { @@ -157,6 +158,7 @@ class ConstructorsSignaturesTest : BaseAbstractTest() { } } + @OnlyDescriptors("Order of constructors is different in K2") @Test fun `class with a parameterless secondary constructor`() { testInline( @@ -227,6 +229,7 @@ class ConstructorsSignaturesTest : BaseAbstractTest() { } + @OnlyDescriptors("Order of constructors is different in K2") @Test fun `class with a few documented constructors`() { testInline( diff --git a/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt b/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt index efab9aba..6423655a 100644 --- a/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt +++ b/plugins/base/src/test/kotlin/filter/JavaVisibilityFilterTest.kt @@ -11,8 +11,10 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.MethodSource import testApi.testRunner.dokkaConfiguration +import utils.JavaCode import kotlin.test.assertEquals +@JavaCode class JavaVisibilityFilterTest : BaseAbstractTest() { @Test diff --git a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt index f4ef85b9..af77d61c 100644 --- a/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt +++ b/plugins/base/src/test/kotlin/filter/KotlinArrayDocumentableReplacerTest.kt @@ -8,6 +8,7 @@ import org.jetbrains.dokka.model.GenericTypeConstructor import org.jetbrains.dokka.model.Invariance import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test +import utils.OnlyDescriptors class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { @@ -157,6 +158,8 @@ class KotlinArrayDocumentableReplacerTest : BaseAbstractTest() { } } } + + @OnlyDescriptors("Fix module.contentScope in new Standalone API") // TODO fix module.contentScope [getKtModuleForKtElement] @Test fun `no jvm source set`() { val configurationWithNoJVM = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt index be75e01f..ccf62641 100644 --- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt +++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt @@ -10,6 +10,8 @@ import org.jetbrains.dokka.pages.* import org.jsoup.Jsoup import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test +import utils.OnlyDescriptors +import utils.OnlyDescriptorsMPP import utils.TestOutputWriterPlugin import utils.assertNotNull import java.net.URL @@ -18,6 +20,7 @@ import kotlin.test.assertEquals class LinkableContentTest : BaseAbstractTest() { + @OnlyDescriptorsMPP @Test fun `Include module and package documentation`() { @@ -143,6 +146,7 @@ class LinkableContentTest : BaseAbstractTest() { } } + @OnlyDescriptorsMPP @Test fun `Samples multiplatform documentation`() { diff --git a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt index 14875832..9ba428d6 100644 --- a/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt +++ b/plugins/base/src/test/kotlin/linking/EnumValuesLinkingTest.kt @@ -11,11 +11,13 @@ import org.jsoup.Jsoup import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Test +import utils.OnlyDescriptors import utils.TestOutputWriterPlugin import java.nio.file.Paths class EnumValuesLinkingTest : BaseAbstractTest() { + @OnlyDescriptors // TODO @Test fun `check if enum values are correctly linked`() { val writerPlugin = TestOutputWriterPlugin() diff --git a/plugins/base/src/test/kotlin/markdown/LinkTest.kt b/plugins/base/src/test/kotlin/markdown/LinkTest.kt index 526ff0eb..8ee5a20d 100644 --- a/plugins/base/src/test/kotlin/markdown/LinkTest.kt +++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt @@ -11,8 +11,10 @@ import org.jetbrains.dokka.pages.MemberPageNode import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Test +import utils.UsingJDK class LinkTest : BaseAbstractTest() { + @UsingJDK @Test fun linkToClassLoader() { val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt index 41b086ee..e10a2260 100644 --- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt +++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt @@ -1473,6 +1473,7 @@ class ParserTest : KDocTest() { executeTest(kdoc, expectedDocumentationNode) } + @Test fun `exception thrown by empty header should point to location of a file`() { val kdoc = """ @@ -1481,9 +1482,10 @@ class ParserTest : KDocTest() { val expectedDocumentationNode = DocumentationNode(emptyList()) val exception = runCatching { executeTest(kdoc, expectedDocumentationNode) }.exceptionOrNull() - assertEquals( - "Wrong AST Tree. Header does not contain expected content in Test.kt/example.Test, element starts from offset 0 and ends 3: ###", - exception?.message + val expectedMessage = "Wrong AST Tree. Header does not contain expected content in Test.kt/example.Test, element starts from offset 0 and ends 3: ###" + assert( + exception?.message == expectedMessage + || /* for K2 */ exception?.cause?.cause?.message == expectedMessage ) } diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index 807ede78..e358945e 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -7,10 +7,7 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.KotlinModifier.* import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Test -import utils.AbstractModelTest -import utils.assertNotNull -import utils.name -import utils.supers +import utils.* class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "classes") { @@ -411,6 +408,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } + @OnlyDescriptors("Bug in descriptors, DRI of entry should have [EnumEntryDRIExtra]") @Test fun javaAnnotationClass() { inlineModelTest( @@ -523,6 +521,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } + @UsingJDK @Test fun doublyTypealiasedException() { inlineModelTest( diff --git a/plugins/base/src/test/kotlin/model/ExtensionsTest.kt b/plugins/base/src/test/kotlin/model/ExtensionsTest.kt index e28b442f..b54f8deb 100644 --- a/plugins/base/src/test/kotlin/model/ExtensionsTest.kt +++ b/plugins/base/src/test/kotlin/model/ExtensionsTest.kt @@ -8,6 +8,7 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.properties.WithExtraProperties import org.junit.jupiter.api.Test import utils.AbstractModelTest +import utils.UsingJDK class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "classes") { private fun <T : WithExtraProperties<R>, R : Documentable> T.checkExtension(name: String = "extension") = @@ -66,6 +67,7 @@ class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "cl } } + @UsingJDK @Test fun `should be extension for external classes`() { inlineModelTest( @@ -85,7 +87,7 @@ class ExtensionsTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "cl } } } - + @Test fun `should be extension for typealias`() { inlineModelTest( diff --git a/plugins/base/src/test/kotlin/model/FunctionsTest.kt b/plugins/base/src/test/kotlin/model/FunctionsTest.kt index fa65a477..3410f9ef 100644 --- a/plugins/base/src/test/kotlin/model/FunctionsTest.kt +++ b/plugins/base/src/test/kotlin/model/FunctionsTest.kt @@ -3,10 +3,7 @@ package model 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.comments -import utils.name +import utils.* class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "function") { @@ -213,6 +210,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun } } + @OnlyDescriptors("Bug in descriptors, DRI of entry should have [EnumEntryDRIExtra]") @Test fun functionWithAnnotatedParam() { inlineModelTest( @@ -274,6 +272,7 @@ class FunctionTest : AbstractModelTest("/src/main/kotlin/function/Test.kt", "fun } } + @OnlyDescriptors("Bug in descriptors, DRI of entry should have [EnumEntryDRIExtra]") @Test fun annotatedFunctionWithAnnotationParameters() { inlineModelTest( diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index f57c3c8c..a0605a5e 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -9,12 +9,11 @@ import org.jetbrains.dokka.model.doc.Param import org.jetbrains.dokka.model.doc.Text import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -import utils.AbstractModelTest +import utils.* import utils.assertContains -import utils.assertNotNull -import utils.name import kotlin.test.assertEquals +@JavaCode class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { val configuration = dokkaConfiguration { sourceSets { diff --git a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt index 5fe17fc8..6f08c89d 100644 --- a/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt +++ b/plugins/base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt @@ -9,9 +9,11 @@ import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.utilities.firstIsInstanceOrNull import org.junit.jupiter.api.Test import translators.documentationOf +import utils.JavaCode import utils.docs import kotlin.test.assertEquals +@JavaCode class MultiLanguageInheritanceTest : BaseAbstractTest() { val configuration = dokkaConfiguration { suppressObviousFunctions = false diff --git a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt index d6564343..35997681 100644 --- a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt +++ b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsForParametersTest.kt @@ -6,9 +6,11 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.utilities.cast import org.junit.jupiter.api.Test import utils.AbstractModelTest +import utils.JavaCode import kotlin.test.assertEquals import kotlin.test.assertTrue +@JavaCode class JavaAnnotationsForParametersTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { @Test diff --git a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt index e704bf71..0abf504e 100644 --- a/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/model/annotations/JavaAnnotationsTest.kt @@ -4,11 +4,13 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.* import org.junit.jupiter.api.Test import translators.findClasslike +import utils.JavaCode import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertNotNull import kotlin.test.assertTrue +@JavaCode class JavaAnnotationsTest : BaseAbstractTest() { val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt index f4615216..4b376c73 100644 --- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt +++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt @@ -10,10 +10,12 @@ import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.utilities.firstIsInstanceOrNull import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test +import utils.JavaCode import utils.docs import utils.text import kotlin.test.assertNotNull +@JavaCode class JavadocParserTest : BaseAbstractTest() { private val configuration = dokkaConfiguration { diff --git a/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt b/plugins/base/src/test/kotlin/renderers/html/NavigationIconTest.kt index 5e2560bf..fb2c53cd 100644 --- a/plugins/base/src/test/kotlin/rend |
