diff options
44 files changed, 316 insertions, 28 deletions
diff --git a/core/build.gradle b/core/build.gradle index 76601901..f3fe35e4 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -50,6 +50,7 @@ dependencies { testImplementation "org.jetbrains.kotlin:kotlin-stdlib-js:$bundled_kotlin_compiler_version" testImplementation "org.jetbrains.kotlin:kotlin-stdlib-common:$bundled_kotlin_compiler_version" + testImplementation project(":core:testApi") testCompile ideaRT() } diff --git a/core/src/test/kotlin/format/GFMFormatTest.kt b/core/src/test/kotlin/format/GFMFormatTest.kt index 60de7d29..4807d0f2 100644 --- a/core/src/test/kotlin/format/GFMFormatTest.kt +++ b/core/src/test/kotlin/format/GFMFormatTest.kt @@ -3,6 +3,8 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.GFMFormatService import org.jetbrains.dokka.KotlinLanguageService import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.verifyOutput import org.junit.Test abstract class BaseGFMFormatTest(val analysisPlatform: Platform) : FileGeneratorTestCase() { @@ -23,8 +25,8 @@ abstract class BaseGFMFormatTest(val analysisPlatform: Platform) : FileGenerator private fun verifyGFMNodeByName(fileName: String, name: String, modelConfig: ModelConfig) { verifyOutput("testdata/format/gfm/$fileName.kt", ".md", modelConfig) { model, output -> buildPagesAndReadInto( - model.members.single().members.filter { it.name == name }, - output + model.members.single().members.filter { it.name == name }, + output ) } } diff --git a/core/src/test/kotlin/format/HtmlFormatTest.kt b/core/src/test/kotlin/format/HtmlFormatTest.kt index 60e29006..a1742280 100644 --- a/core/src/test/kotlin/format/HtmlFormatTest.kt +++ b/core/src/test/kotlin/format/HtmlFormatTest.kt @@ -1,6 +1,9 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.* +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.verifyJavaOutput +import org.jetbrains.dokka.testApi.verifyOutput import org.jetbrains.kotlin.cli.common.config.KotlinSourceRoot import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot import org.junit.Test diff --git a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt index ebab5f36..d8b34394 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt @@ -2,6 +2,10 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.* import org.jetbrains.dokka.Generation.DocumentationMerger +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.appendDocumentation +import org.jetbrains.dokka.testApi.verifyModelOutput +import org.jetbrains.dokka.testApi.verifyOutput import org.junit.Test abstract class BaseKotlinWebSiteHtmlFormatTest(val analysisPlatform: Platform): FileGeneratorTestCase() { @@ -65,14 +69,14 @@ abstract class BaseKotlinWebSiteHtmlFormatTest(val analysisPlatform: Platform): private fun buildMultiplePlatforms(path: String): DocumentationModule { val moduleName = "test" - val passConfiguration = PassConfigurationImpl( + val passConfiguration = org.jetbrains.dokka.testApi.PassConfigurationImpl( noStdlibLink = true, noJdkLink = true, languageVersion = null, apiVersion = null ) - val dokkaConfiguration = DokkaConfigurationImpl( + val dokkaConfiguration = org.jetbrains.dokka.testApi.DokkaConfigurationImpl( outputDir = "", format = "kotlin-website-html", generateIndexPages = false, diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index 4984e1d5..8900b267 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -2,6 +2,7 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.* import org.jetbrains.dokka.Generation.DocumentationMerger +import org.jetbrains.dokka.testApi.* import org.junit.Test abstract class BaseMarkdownFormatTest(val analysisPlatform: Platform): FileGeneratorTestCase() { @@ -257,14 +258,14 @@ abstract class BaseMarkdownFormatTest(val analysisPlatform: Platform): FileGener @Test fun packagePlatformsWithExtExtensions() { val path = "multiplatform/packagePlatformsWithExtExtensions" val module = DocumentationModule("test") - val passConfiguration = PassConfigurationImpl( + val passConfiguration = org.jetbrains.dokka.testApi.PassConfigurationImpl( noStdlibLink = true, noJdkLink = true, languageVersion = null, apiVersion = null ) - val dokkaConfiguration = DokkaConfigurationImpl( + val dokkaConfiguration = org.jetbrains.dokka.testApi.DokkaConfigurationImpl( outputDir = "", format = "html", generateIndexPages = false, @@ -388,13 +389,13 @@ abstract class BaseMarkdownFormatTest(val analysisPlatform: Platform): FileGener private fun buildMultiplePlatforms(path: String): DocumentationModule { val moduleName = "test" - val passConfiguration = PassConfigurationImpl( + val passConfiguration = org.jetbrains.dokka.testApi.PassConfigurationImpl( noStdlibLink = true, noJdkLink = true, languageVersion = null, apiVersion = null ) - val dokkaConfiguration = DokkaConfigurationImpl( + val dokkaConfiguration = org.jetbrains.dokka.testApi.DokkaConfigurationImpl( outputDir = "", format = "html", generateIndexPages = false, diff --git a/core/src/test/kotlin/format/PackageDocsTest.kt b/core/src/test/kotlin/format/PackageDocsTest.kt index 3ff5f123..c5fe7beb 100644 --- a/core/src/test/kotlin/format/PackageDocsTest.kt +++ b/core/src/test/kotlin/format/PackageDocsTest.kt @@ -7,10 +7,9 @@ import com.nhaarman.mockito_kotlin.doAnswer import com.nhaarman.mockito_kotlin.eq import com.nhaarman.mockito_kotlin.mock import org.jetbrains.dokka.* -import org.jetbrains.dokka.tests.assertEqualsIgnoringSeparators +import org.jetbrains.dokka.testApi.assertEqualsIgnoringSeparators import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor import org.junit.After diff --git a/core/src/test/kotlin/issues/IssuesTest.kt b/core/src/test/kotlin/issues/IssuesTest.kt index da5acd6e..80370d5e 100644 --- a/core/src/test/kotlin/issues/IssuesTest.kt +++ b/core/src/test/kotlin/issues/IssuesTest.kt @@ -3,8 +3,8 @@ package issues import org.jetbrains.dokka.DocumentationNode import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.tests.ModelConfig -import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel import org.junit.Test import kotlin.test.assertEquals diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/ClassTest.kt index 35ec1d09..b479e59e 100644 --- a/core/src/test/kotlin/model/ClassTest.kt +++ b/core/src/test/kotlin/model/ClassTest.kt @@ -4,6 +4,10 @@ import org.jetbrains.dokka.Content import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform import org.jetbrains.dokka.RefKind +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString +import org.jetbrains.dokka.testApi.verifyPackageMember import org.junit.Assert import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue diff --git a/core/src/test/kotlin/model/CommentTest.kt b/core/src/test/kotlin/model/CommentTest.kt index 08aa3572..b94e9d0c 100644 --- a/core/src/test/kotlin/model/CommentTest.kt +++ b/core/src/test/kotlin/model/CommentTest.kt @@ -1,8 +1,13 @@ package org.jetbrains.dokka.tests +import org.jetbrains.dokka.Content +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.assertEqualsIgnoringSeparators +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* -import org.jetbrains.dokka.* abstract class BaseCommentTest(val analysisPlatform: Platform) { val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform) diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt index 4c6bfb74..9900446a 100644 --- a/core/src/test/kotlin/model/FunctionTest.kt +++ b/core/src/test/kotlin/model/FunctionTest.kt @@ -3,7 +3,10 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.Content import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform -import org.jetbrains.kotlin.analyzer.PlatformAnalysisParameters +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString +import org.jetbrains.dokka.testApi.verifyPackageMember import org.junit.Assert import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue diff --git a/core/src/test/kotlin/model/JavaTest.kt b/core/src/test/kotlin/model/JavaTest.kt index da9da624..018ab089 100644 --- a/core/src/test/kotlin/model/JavaTest.kt +++ b/core/src/test/kotlin/model/JavaTest.kt @@ -3,6 +3,9 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform import org.jetbrains.dokka.RefKind +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.toTestString +import org.jetbrains.dokka.testApi.verifyJavaPackageMember import org.junit.Assert.* import org.junit.Ignore import org.junit.Test diff --git a/core/src/test/kotlin/model/KotlinAsJavaTest.kt b/core/src/test/kotlin/model/KotlinAsJavaTest.kt index 8249dd0f..80ff95bd 100644 --- a/core/src/test/kotlin/model/KotlinAsJavaTest.kt +++ b/core/src/test/kotlin/model/KotlinAsJavaTest.kt @@ -4,6 +4,9 @@ import org.jetbrains.dokka.DocumentationModule import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform import org.jetbrains.dokka.RefKind +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString import org.junit.Assert import org.junit.Assert.assertEquals import org.junit.Test diff --git a/core/src/test/kotlin/model/LinkTest.kt b/core/src/test/kotlin/model/LinkTest.kt index 6526a4db..08e27db8 100644 --- a/core/src/test/kotlin/model/LinkTest.kt +++ b/core/src/test/kotlin/model/LinkTest.kt @@ -4,6 +4,9 @@ import org.jetbrains.dokka.ContentBlock import org.jetbrains.dokka.ContentNodeLazyLink import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString import org.junit.Assert.assertEquals import org.junit.Test diff --git a/core/src/test/kotlin/model/PackageTest.kt b/core/src/test/kotlin/model/PackageTest.kt index 47c88385..0afbbb5d 100644 --- a/core/src/test/kotlin/model/PackageTest.kt +++ b/core/src/test/kotlin/model/PackageTest.kt @@ -1,6 +1,9 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.* +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.verifyModel import org.jetbrains.kotlin.cli.common.config.KotlinSourceRoot import org.junit.Assert.* import org.junit.Test @@ -121,7 +124,7 @@ abstract class BasePackageTest(val analysisPlatform: Platform) { ModelConfig( roots = arrayOf(KotlinSourceRoot("testdata/packages/classInPackage.kt", false)), perPackageOptions = listOf( - PackageOptionsImpl(prefix = "simple.name", suppress = true) + org.jetbrains.dokka.testApi.PackageOptionsImpl(prefix = "simple.name", suppress = true) ), analysisPlatform = analysisPlatform ) diff --git a/core/src/test/kotlin/model/PropertyTest.kt b/core/src/test/kotlin/model/PropertyTest.kt index 9f070862..bce3c585 100644 --- a/core/src/test/kotlin/model/PropertyTest.kt +++ b/core/src/test/kotlin/model/PropertyTest.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.* +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel import org.junit.Assert import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue diff --git a/core/src/test/kotlin/model/SourceLinksErrorTest.kt b/core/src/test/kotlin/model/SourceLinksErrorTest.kt index 9812569d..2d587856 100644 --- a/core/src/test/kotlin/model/SourceLinksErrorTest.kt +++ b/core/src/test/kotlin/model/SourceLinksErrorTest.kt @@ -2,8 +2,8 @@ package org.jetbrains.dokka.tests.model import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.SourceLinkDefinitionImpl -import org.jetbrains.dokka.tests.ModelConfig -import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel import org.junit.Assert import org.junit.Test import java.io.File diff --git a/core/src/test/kotlin/model/SourceLinksTest.kt b/core/src/test/kotlin/model/SourceLinksTest.kt index a4ba870c..8f7766f6 100644 --- a/core/src/test/kotlin/model/SourceLinksTest.kt +++ b/core/src/test/kotlin/model/SourceLinksTest.kt @@ -2,8 +2,8 @@ package org.jetbrains.dokka.tests.model import org.jetbrains.dokka.NodeKind import org.jetbrains.dokka.SourceLinkDefinitionImpl -import org.jetbrains.dokka.tests.ModelConfig -import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith diff --git a/core/src/test/kotlin/model/TypeAliasTest.kt b/core/src/test/kotlin/model/TypeAliasTest.kt index 71976dc3..6c9b90a8 100644 --- a/core/src/test/kotlin/model/TypeAliasTest.kt +++ b/core/src/test/kotlin/model/TypeAliasTest.kt @@ -3,6 +3,8 @@ package org.jetbrains.dokka.tests import junit.framework.TestCase.assertEquals import org.jetbrains.dokka.Content import org.jetbrains.dokka.NodeKind +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.toTestString import org.junit.Test class TypeAliasTest { diff --git a/core/testApi/build.gradle b/core/testApi/build.gradle index 3d5bb61a..82d0fd41 100644 --- a/core/testApi/build.gradle +++ b/core/testApi/build.gradle @@ -1,3 +1,6 @@ dependencies { compileOnly project(":core") + implementation group: 'junit', name: 'junit', version: '4.12' + implementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version + implementation ideaRT() }
\ No newline at end of file diff --git a/core/src/test/kotlin/DokkaConfigurationTestImplementations.kt b/core/testApi/src/main/kotlin/testApi/DokkaConfigurationTestImplementations.kt index a6f427b1..58356e27 100644 --- a/core/src/test/kotlin/DokkaConfigurationTestImplementations.kt +++ b/core/testApi/src/main/kotlin/testApi/DokkaConfigurationTestImplementations.kt @@ -1,4 +1,4 @@ -package org.jetbrains.dokka.tests +package org.jetbrains.dokka.testApi import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.Platform @@ -13,8 +13,8 @@ data class SourceLinkDefinitionImpl(override val path: String, val (path, urlAndLine) = srcLink.split('=') return SourceLinkDefinitionImpl( File(path).canonicalPath, - urlAndLine.substringBefore("#"), - urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#$it" }) + urlAndLine.substringBefore("#"), + urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#$it" }) } } } diff --git a/core/src/test/kotlin/TestAPI.kt b/core/testApi/src/main/kotlin/testApi/TestAPI.kt index 4f9af761..7856591c 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/testApi/src/main/kotlin/testApi/TestAPI.kt @@ -1,4 +1,4 @@ -package org.jetbrains.dokka.tests +package org.jetbrains.dokka.testApi import com.google.inject.Guice import com.intellij.openapi.application.PathManager diff --git a/plugins/javadoc8/build.gradle b/plugins/javadoc8/build.gradle index e44fc94a..4f8d317b 100644 --- a/plugins/javadoc8/build.gradle +++ b/plugins/javadoc8/build.gradle @@ -8,7 +8,9 @@ dependencies { def toolsJar = files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") }) compileOnly toolsJar testCompile toolsJar - testCompile project(":core").sourceSets.test.output +// testCompile project(":core").sourceSets.test.output + + testImplementation project(":core:testApi") testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version }
\ No newline at end of file diff --git a/plugins/javadoc8/src/test/kotlin/javadoc/JavadocTest.kt b/plugins/javadoc8/src/test/kotlin/javadoc/JavadocTest.kt index 1c4dd258..b65c8a3b 100644 --- a/plugins/javadoc8/src/test/kotlin/javadoc/JavadocTest.kt +++ b/plugins/javadoc8/src/test/kotlin/javadoc/JavadocTest.kt @@ -4,9 +4,9 @@ import com.sun.javadoc.Tag import com.sun.javadoc.Type import org.jetbrains.dokka.DokkaConsoleLogger import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.tests.ModelConfig -import org.jetbrains.dokka.tests.assertEqualsIgnoringSeparators -import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel +import org.jetbrains.dokka.testApi.ModelConfig +import org.jetbrains.dokka.testApi.assertEqualsIgnoringSeparators +import org.jetbrains.dokka.testApi.checkSourceExistsAndVerifyModel import org.junit.Assert.* import org.junit.Test import java.lang.reflect.Modifier.* diff --git a/plugins/javadoc8/testdata/javadoc/argumentReference.kt b/plugins/javadoc8/testdata/javadoc/argumentReference.kt new file mode 100644 index 00000000..ac3104e9 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/argumentReference.kt @@ -0,0 +1,4 @@ +/** + * [error] + */ +fun argNamedError(error: String) {}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/blankLineInsideCodeBlock.kt b/plugins/javadoc8/testdata/javadoc/blankLineInsideCodeBlock.kt new file mode 100644 index 00000000..9430f4d5 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/blankLineInsideCodeBlock.kt @@ -0,0 +1,12 @@ +/** + * ``` + * This is a test + * of Dokka's code blocks. + * Here is a blank line. + * + * The previous line was blank. + * ``` + */ +fun u() { + +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/bytearr.kt b/plugins/javadoc8/testdata/javadoc/bytearr.kt new file mode 100644 index 00000000..84be1a70 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/bytearr.kt @@ -0,0 +1,7 @@ +package foo + +class ByteArray { + fun foo(): IntArray { + return intArrayOf() + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/companionMethodReference.kt b/plugins/javadoc8/testdata/javadoc/companionMethodReference.kt new file mode 100644 index 00000000..499e4492 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/companionMethodReference.kt @@ -0,0 +1,13 @@ +package foo + + +/** + * Linking to [test] + */ +class TestClass { + + companion object { + + @JvmStatic fun test(arg: String) {} + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/constructorParameters.kt b/plugins/javadoc8/testdata/javadoc/constructorParameters.kt new file mode 100644 index 00000000..c29ae912 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/constructorParameters.kt @@ -0,0 +1,14 @@ +package bar + +/** + * Just a fruit + * + * @param weight in grams + * @param ranking quality from 0 to 10, where 10 is best + * @param color yellow is default + */ +class Banana ( + private val weight: Double, + private val ranking: Int, + color: String = "yellow" +)
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/defaultNoArgConstructor.kt b/plugins/javadoc8/testdata/javadoc/defaultNoArgConstructor.kt new file mode 100644 index 00000000..3a6d04a5 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/defaultNoArgConstructor.kt @@ -0,0 +1,12 @@ +package foo + +/** + * Description + * + * @constructor print peach + */ +class Peach { + init { + println("peach") + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/deprecated.java b/plugins/javadoc8/testdata/javadoc/deprecated.java new file mode 100644 index 00000000..5a6cdd77 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/deprecated.java @@ -0,0 +1,28 @@ +package bar; + +/** + * Just a fruit + */ +public class Banana { + private Double weight; + + /** + * Returns weight + * + * @return weight + * @deprecated + */ + public Double getWeight() { + return weight; + } + + /** + * Sets weight + * + * @param weight in grams + * @deprecated with message + */ + public void setWeight(Double weight) { + this.weight = weight; + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/exception.kt b/plugins/javadoc8/testdata/javadoc/exception.kt new file mode 100644 index 00000000..ec0a5bbb --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/exception.kt @@ -0,0 +1,5 @@ +package foo + +class MyException : Exception { + fun foo() = "" +} diff --git a/plugins/javadoc8/testdata/javadoc/functionParameters.java b/plugins/javadoc8/testdata/javadoc/functionParameters.java new file mode 100644 index 00000000..8d5f5143 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/functionParameters.java @@ -0,0 +1,17 @@ +package bar; + +/** + * Foo + */ + +public class Foo { + + /** perfom request + * + * @param name user name + * @param password user password + */ + public void request(String name, String password) { + + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/internal.kt b/plugins/javadoc8/testdata/javadoc/internal.kt new file mode 100644 index 00000000..a57ea3b4 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/internal.kt @@ -0,0 +1,8 @@ +package foo + +data class Person internal constructor( + val name: String = "", + val age: Int = 0 +) { + constructor(age: Int): this("", age) +} diff --git a/plugins/javadoc8/testdata/javadoc/jvmname.kt b/plugins/javadoc8/testdata/javadoc/jvmname.kt new file mode 100644 index 00000000..e4774cd6 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/jvmname.kt @@ -0,0 +1,6 @@ +package foo + +class Apple { + @get:JvmName("_tree") + internal val source: Tree +} diff --git a/plugins/javadoc8/testdata/javadoc/kdocKeywordsOnMethod.kt b/plugins/javadoc8/testdata/javadoc/kdocKeywordsOnMethod.kt new file mode 100644 index 00000000..df5bbbe0 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/kdocKeywordsOnMethod.kt @@ -0,0 +1,12 @@ +class FireException : Exception + + +/** + * COMM + * @param a Some string + * @return value of a + * @throws FireException in case of fire + */ +@Throws(FireException::class) +fun my(a: String): String = a + diff --git a/plugins/javadoc8/testdata/javadoc/noArgConstructor.kt b/plugins/javadoc8/testdata/javadoc/noArgConstructor.kt new file mode 100644 index 00000000..25e5548c --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/noArgConstructor.kt @@ -0,0 +1,12 @@ +package foo + +/** + * Description + * + * @constructor print plum + */ +class Plum() { + init { + println("plum") + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/obj.kt b/plugins/javadoc8/testdata/javadoc/obj.kt new file mode 100644 index 00000000..1d10a422 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/obj.kt @@ -0,0 +1,7 @@ +package foo + +class O { + companion object { + + } +} diff --git a/plugins/javadoc8/testdata/javadoc/paramlink.kt b/plugins/javadoc8/testdata/javadoc/paramlink.kt new file mode 100644 index 00000000..48972a22 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/paramlink.kt @@ -0,0 +1,10 @@ +package demo + +/** + * You can [eat] it or cut it into slices using [cutIntoPieces] + */ +interface Apple { + fun eat() + + fun cutIntoPieces(pieces: Int) +} diff --git a/plugins/javadoc8/testdata/javadoc/stringarr.kt b/plugins/javadoc8/testdata/javadoc/stringarr.kt new file mode 100644 index 00000000..d6cd9dea --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/stringarr.kt @@ -0,0 +1,8 @@ +package foo + +class Foo { + companion object { + @JvmStatic fun main(args: Array<String>) { + } + } +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/suppress.kt b/plugins/javadoc8/testdata/javadoc/suppress.kt new file mode 100644 index 00000000..90f6c131 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/suppress.kt @@ -0,0 +1,37 @@ +/** + * @suppress + */ +class Some { + +} + + +/** + * @suppress + * @author me + * @see other + */ +class SomeAgain { + +} + +class Same { + /** + * @suppress + */ + fun privateApi() { + + } + + /** + * @suppress + */ + val privateForSomeReason = "" +} + +/** + * @suppress + */ +interface Interface { + +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/typealiases.kt b/plugins/javadoc8/testdata/javadoc/typealiases.kt new file mode 100644 index 00000000..bb09bfad --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/typealiases.kt @@ -0,0 +1,11 @@ +class A + +typealias B = A + +class C : B + +typealias D = (A) -> C + +fun some(d: D) { + +}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/types.kt b/plugins/javadoc8/testdata/javadoc/types.kt new file mode 100644 index 00000000..55be6058 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/types.kt @@ -0,0 +1,4 @@ +package foo + +fun foo(x: Int, o: Any): String { +} diff --git a/plugins/javadoc8/testdata/javadoc/vararg.kt b/plugins/javadoc8/testdata/javadoc/vararg.kt new file mode 100644 index 00000000..aa6c26d7 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/vararg.kt @@ -0,0 +1,3 @@ +fun vararg(a: String, vararg b: Int) {} + +fun varargInMiddle(a: String, vararg b: Int, c: Short) {}
\ No newline at end of file diff --git a/plugins/javadoc8/testdata/javadoc/visibilityModifiers.kt b/plugins/javadoc8/testdata/javadoc/visibilityModifiers.kt new file mode 100644 index 00000000..e48e7f62 --- /dev/null +++ b/plugins/javadoc8/testdata/javadoc/visibilityModifiers.kt @@ -0,0 +1,15 @@ +package foo + +abstract class Apple { + protected var name: String = "foo" + internal var weight: Int = 180 + var rating: Int = 10 + private var color: String = "red" + + companion object { + @JvmStatic + val code : Int = 123456 + } + + +}
\ No newline at end of file |