aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/javadoc/JavadocTest.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-12-03 16:22:11 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-12-03 16:22:49 +0100
commit39631054c58df5841ea268b7002b820ec55f6e0a (patch)
treecefedd8411c859243bd181568e16fcdd372a38c8 /core/src/test/kotlin/javadoc/JavadocTest.kt
parent797cb4732c53bf1e3b2091add8cf731fc436607f (diff)
downloaddokka-39631054c58df5841ea268b7002b820ec55f6e0a.tar.gz
dokka-39631054c58df5841ea268b7002b820ec55f6e0a.tar.bz2
dokka-39631054c58df5841ea268b7002b820ec55f6e0a.zip
restructure Dokka build to use Gradle for everything except for the Maven plugin
Diffstat (limited to 'core/src/test/kotlin/javadoc/JavadocTest.kt')
-rw-r--r--core/src/test/kotlin/javadoc/JavadocTest.kt44
1 files changed, 44 insertions, 0 deletions
diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt
new file mode 100644
index 00000000..4f0049ac
--- /dev/null
+++ b/core/src/test/kotlin/javadoc/JavadocTest.kt
@@ -0,0 +1,44 @@
+package org.jetbrains.dokka.javadoc
+
+import org.jetbrains.dokka.DokkaConsoleLogger
+import org.jetbrains.dokka.tests.verifyModel
+import org.junit.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertFalse
+import kotlin.test.assertNotNull
+import kotlin.test.assertTrue
+
+class JavadocTest {
+ @Test fun testTypes() {
+ verifyModel("testdata/javadoc/types.kt", format = "javadoc", withJdk = true) { model ->
+ val doc = ModuleNodeAdapter(model, StandardReporter(DokkaConsoleLogger), "")
+ val classDoc = doc.classNamed("foo.TypesKt")!!
+ val method = classDoc.methods().find { it.name() == "foo" }!!
+
+ val type = method.returnType()
+ assertFalse(type.asClassDoc().isIncluded)
+ assertEquals("java.lang.String", type.qualifiedTypeName())
+ assertEquals("java.lang.String", type.asClassDoc().qualifiedName())
+
+ val params = method.parameters()
+ assertTrue(params[0].type().isPrimitive)
+ assertFalse(params[1].type().asClassDoc().isIncluded)
+ }
+ }
+
+ @Test fun testObject() {
+ verifyModel("testdata/javadoc/obj.kt", format = "javadoc") { model ->
+ val doc = ModuleNodeAdapter(model, StandardReporter(DokkaConsoleLogger), "")
+
+ val classDoc = doc.classNamed("foo.O")
+ assertNotNull(classDoc)
+
+ val companionDoc = doc.classNamed("foo.O.Companion")
+ assertNotNull(companionDoc)
+
+ val pkgDoc = doc.packageNamed("foo")!!
+ assertEquals(2, pkgDoc.allClasses().size)
+ }
+ }
+
+}