aboutsummaryrefslogtreecommitdiff
path: root/javadoc/src/test/kotlin/JavadocTest.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-11-05 15:51:23 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-11-05 15:51:23 +0100
commitb643bf6f4b4c29676ce3301d92b7880b268d6722 (patch)
tree8f0fede2d5eac2110ca4687a35eefb8727ed4d7e /javadoc/src/test/kotlin/JavadocTest.kt
parent0bad64896baed4056d75f8b948afe0d848bc8adf (diff)
downloaddokka-b643bf6f4b4c29676ce3301d92b7880b268d6722.tar.gz
dokka-b643bf6f4b4c29676ce3301d92b7880b268d6722.tar.bz2
dokka-b643bf6f4b4c29676ce3301d92b7880b268d6722.zip
add tests; fixes related to qualified names of types
Diffstat (limited to 'javadoc/src/test/kotlin/JavadocTest.kt')
-rw-r--r--javadoc/src/test/kotlin/JavadocTest.kt44
1 files changed, 44 insertions, 0 deletions
diff --git a/javadoc/src/test/kotlin/JavadocTest.kt b/javadoc/src/test/kotlin/JavadocTest.kt
new file mode 100644
index 00000000..1ac7069b
--- /dev/null
+++ b/javadoc/src/test/kotlin/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("javadoc/src/test/data/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("javadoc/src/test/data/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)
+ }
+ }
+
+}