From f4920fc9d067e59a5d843a185e07c5d321c91c6d Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 11 Sep 2019 15:34:55 +0200 Subject: Extract testApi from core --- plugins/javadoc8/build.gradle | 4 ++- .../src/test/kotlin/javadoc/JavadocTest.kt | 6 ++-- .../javadoc8/testdata/javadoc/argumentReference.kt | 4 +++ .../testdata/javadoc/blankLineInsideCodeBlock.kt | 12 +++++++ plugins/javadoc8/testdata/javadoc/bytearr.kt | 7 ++++ .../testdata/javadoc/companionMethodReference.kt | 13 ++++++++ .../testdata/javadoc/constructorParameters.kt | 14 ++++++++ .../testdata/javadoc/defaultNoArgConstructor.kt | 12 +++++++ plugins/javadoc8/testdata/javadoc/deprecated.java | 28 ++++++++++++++++ plugins/javadoc8/testdata/javadoc/exception.kt | 5 +++ .../testdata/javadoc/functionParameters.java | 17 ++++++++++ plugins/javadoc8/testdata/javadoc/internal.kt | 8 +++++ plugins/javadoc8/testdata/javadoc/jvmname.kt | 6 ++++ .../testdata/javadoc/kdocKeywordsOnMethod.kt | 12 +++++++ .../javadoc8/testdata/javadoc/noArgConstructor.kt | 12 +++++++ plugins/javadoc8/testdata/javadoc/obj.kt | 7 ++++ plugins/javadoc8/testdata/javadoc/paramlink.kt | 10 ++++++ plugins/javadoc8/testdata/javadoc/stringarr.kt | 8 +++++ plugins/javadoc8/testdata/javadoc/suppress.kt | 37 ++++++++++++++++++++++ plugins/javadoc8/testdata/javadoc/typealiases.kt | 11 +++++++ plugins/javadoc8/testdata/javadoc/types.kt | 4 +++ plugins/javadoc8/testdata/javadoc/vararg.kt | 3 ++ .../testdata/javadoc/visibilityModifiers.kt | 15 +++++++++ 23 files changed, 251 insertions(+), 4 deletions(-) create mode 100644 plugins/javadoc8/testdata/javadoc/argumentReference.kt create mode 100644 plugins/javadoc8/testdata/javadoc/blankLineInsideCodeBlock.kt create mode 100644 plugins/javadoc8/testdata/javadoc/bytearr.kt create mode 100644 plugins/javadoc8/testdata/javadoc/companionMethodReference.kt create mode 100644 plugins/javadoc8/testdata/javadoc/constructorParameters.kt create mode 100644 plugins/javadoc8/testdata/javadoc/defaultNoArgConstructor.kt create mode 100644 plugins/javadoc8/testdata/javadoc/deprecated.java create mode 100644 plugins/javadoc8/testdata/javadoc/exception.kt create mode 100644 plugins/javadoc8/testdata/javadoc/functionParameters.java create mode 100644 plugins/javadoc8/testdata/javadoc/internal.kt create mode 100644 plugins/javadoc8/testdata/javadoc/jvmname.kt create mode 100644 plugins/javadoc8/testdata/javadoc/kdocKeywordsOnMethod.kt create mode 100644 plugins/javadoc8/testdata/javadoc/noArgConstructor.kt create mode 100644 plugins/javadoc8/testdata/javadoc/obj.kt create mode 100644 plugins/javadoc8/testdata/javadoc/paramlink.kt create mode 100644 plugins/javadoc8/testdata/javadoc/stringarr.kt create mode 100644 plugins/javadoc8/testdata/javadoc/suppress.kt create mode 100644 plugins/javadoc8/testdata/javadoc/typealiases.kt create mode 100644 plugins/javadoc8/testdata/javadoc/types.kt create mode 100644 plugins/javadoc8/testdata/javadoc/vararg.kt create mode 100644 plugins/javadoc8/testdata/javadoc/visibilityModifiers.kt (limited to 'plugins') 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) { + } + } +} \ 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 -- cgit