aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/KotlinAsJavaTest.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-03-18 21:56:14 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-03-18 21:56:14 +0300
commit4b22ebab09ce3b934443d063df6b905e5347c390 (patch)
treef353662dc777107773adf8a5b3cac07b09ab3255 /core/src/test/kotlin/model/KotlinAsJavaTest.kt
parent0fa9b69b6afe762e5aee7b7cf801a38ebe74b2c9 (diff)
parentb566f8852e94f9a17be86bf845aeff6c36bd8378 (diff)
downloaddokka-4b22ebab09ce3b934443d063df6b905e5347c390.tar.gz
dokka-4b22ebab09ce3b934443d063df6b905e5347c390.tar.bz2
dokka-4b22ebab09ce3b934443d063df6b905e5347c390.zip
Merge branch 'dev-pre' into dev
# Conflicts: # core/src/main/kotlin/Model/PackageDocs.kt
Diffstat (limited to 'core/src/test/kotlin/model/KotlinAsJavaTest.kt')
-rw-r--r--core/src/test/kotlin/model/KotlinAsJavaTest.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/src/test/kotlin/model/KotlinAsJavaTest.kt b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
index d24d8bdd..22818038 100644
--- a/core/src/test/kotlin/model/KotlinAsJavaTest.kt
+++ b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
@@ -2,6 +2,8 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.DocumentationModule
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.RefKind
+import org.junit.Assert
import org.junit.Test
import org.junit.Assert.assertEquals
@@ -27,6 +29,24 @@ class KotlinAsJavaTest {
assertEquals("doc", getter.content.summary.toTestString())
}
}
+
+
+ @Test fun constants() {
+ verifyModelAsJava("testdata/java/constants.java") { cls ->
+ selectNodes(cls) {
+ subgraphOf(RefKind.Member)
+ matching { it.name == "constStr" || it.name == "refConst" }
+ }.forEach {
+ assertEquals("In $it", "\"some value\"", it.detailOrNull(NodeKind.Value)?.name)
+ }
+ val nullConstNode = selectNodes(cls) {
+ subgraphOf(RefKind.Member)
+ withName("nullConst")
+ }.single()
+
+ Assert.assertNull(nullConstNode.detailOrNull(NodeKind.Value))
+ }
+ }
}
fun verifyModelAsJava(source: String,