aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model
diff options
context:
space:
mode:
authoraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:37:18 +0300
committeraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:37:18 +0300
commit960ea9ebb01f280c4966e139c1697f083e9d8965 (patch)
tree05bb14e7faf1b74a0abf89f69a73023b4373eefd /core/src/test/kotlin/model
parent65b61e31b761071589e257381bea33557d932412 (diff)
downloaddokka-960ea9ebb01f280c4966e139c1697f083e9d8965.tar.gz
dokka-960ea9ebb01f280c4966e139c1697f083e9d8965.tar.bz2
dokka-960ea9ebb01f280c4966e139c1697f083e9d8965.zip
Test refactoring and split by different platforms
Diffstat (limited to 'core/src/test/kotlin/model')
-rw-r--r--core/src/test/kotlin/model/BaseClassTest.kt (renamed from core/src/test/kotlin/model/ClassTest.kt)74
-rw-r--r--core/src/test/kotlin/model/BasePropertyTest.kt (renamed from core/src/test/kotlin/model/PropertyTest.kt)38
-rw-r--r--core/src/test/kotlin/model/CommentTest.kt28
-rw-r--r--core/src/test/kotlin/model/FunctionTest.kt44
-rw-r--r--core/src/test/kotlin/model/JSClassTest.kt6
-rw-r--r--core/src/test/kotlin/model/JSFunctionTest.kt8
-rw-r--r--core/src/test/kotlin/model/JSPropertyTest.kt8
-rw-r--r--core/src/test/kotlin/model/JVMClassTest.kt55
-rw-r--r--core/src/test/kotlin/model/JVMFunctionTest.kt29
-rw-r--r--core/src/test/kotlin/model/JVMPropertyTest.kt33
-rw-r--r--core/src/test/kotlin/model/JavaTest.kt34
-rw-r--r--core/src/test/kotlin/model/KotlinAsJavaTest.kt14
-rw-r--r--core/src/test/kotlin/model/LinkTest.kt12
-rw-r--r--core/src/test/kotlin/model/PackageTest.kt40
-rw-r--r--core/src/test/kotlin/model/TypeAliasTest.kt18
15 files changed, 285 insertions, 156 deletions
diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/BaseClassTest.kt
index ea586041..d48ecb48 100644
--- a/core/src/test/kotlin/model/ClassTest.kt
+++ b/core/src/test/kotlin/model/BaseClassTest.kt
@@ -2,14 +2,16 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.Content
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.RefKind
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
-class ClassTest {
+abstract class BaseClassTest(val analysisPlatform: Platform) {
+ protected val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform)
@Test fun emptyClass() {
- verifyModel("testdata/classes/emptyClass.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/emptyClass.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(NodeKind.Class, kind)
assertEquals("Klass", name)
@@ -21,7 +23,7 @@ class ClassTest {
}
@Test fun emptyObject() {
- verifyModel("testdata/classes/emptyObject.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/emptyObject.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(NodeKind.Object, kind)
assertEquals("Obj", name)
@@ -33,7 +35,7 @@ class ClassTest {
}
@Test fun classWithConstructor() {
- verifyModel("testdata/classes/classWithConstructor.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/classWithConstructor.kt", defaultModelConfig) { model ->
with (model.members.single().members.single()) {
assertEquals(NodeKind.Class, kind)
assertEquals("Klass", name)
@@ -63,7 +65,7 @@ class ClassTest {
}
@Test fun classWithFunction() {
- verifyModel("testdata/classes/classWithFunction.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/classWithFunction.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(NodeKind.Class, kind)
assertEquals("Klass", name)
@@ -93,7 +95,7 @@ class ClassTest {
}
@Test fun classWithProperty() {
- verifyModel("testdata/classes/classWithProperty.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/classWithProperty.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(NodeKind.Class, kind)
assertEquals("Klass", name)
@@ -123,7 +125,7 @@ class ClassTest {
}
@Test fun classWithCompanionObject() {
- verifyModel("testdata/classes/classWithCompanionObject.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/classWithCompanionObject.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(NodeKind.Class, kind)
assertEquals("Klass", name)
@@ -151,33 +153,25 @@ class ClassTest {
}
}
- @Test fun annotatedClass() {
- verifyPackageMember("testdata/classes/annotatedClass.kt", withKotlinRuntime = true) { cls ->
- assertEquals(1, cls.annotations.count())
- with(cls.annotations[0]) {
- assertEquals("Strictfp", name)
- assertEquals(Content.Empty, content)
- assertEquals(NodeKind.Annotation, kind)
- }
- }
- }
-
@Test fun dataClass() {
- verifyPackageMember("testdata/classes/dataClass.kt") { cls ->
+ verifyPackageMember("testdata/classes/dataClass.kt", defaultModelConfig) { cls ->
val modifiers = cls.details(NodeKind.Modifier).map { it.name }
assertTrue("data" in modifiers)
}
}
@Test fun sealedClass() {
- verifyPackageMember("testdata/classes/sealedClass.kt") { cls ->
+ verifyPackageMember("testdata/classes/sealedClass.kt", defaultModelConfig) { cls ->
val modifiers = cls.details(NodeKind.Modifier).map { it.name }
assertEquals(1, modifiers.count { it == "sealed" })
}
}
@Test fun annotatedClassWithAnnotationParameters() {
- verifyModel("testdata/classes/annotatedClassWithAnnotationParameters.kt") { model ->
+ checkSourceExistsAndVerifyModel(
+ "testdata/classes/annotatedClassWithAnnotationParameters.kt",
+ defaultModelConfig
+ ) { model ->
with(model.members.single().members.single()) {
with(deprecation!!) {
assertEquals("Deprecated", name)
@@ -197,29 +191,8 @@ class ClassTest {
}
}
- @Test fun javaAnnotationClass() {
- verifyModel("testdata/classes/javaAnnotationClass.kt", withJdk = true) { model ->
- with(model.members.single().members.single()) {
- assertEquals(1, annotations.count())
- with(annotations[0]) {
- assertEquals("Retention", name)
- assertEquals(Content.Empty, content)
- assertEquals(NodeKind.Annotation, kind)
- with(details[0]) {
- assertEquals(NodeKind.Parameter, kind)
- assertEquals(1, details.count())
- with(details[0]) {
- assertEquals(NodeKind.Value, kind)
- assertEquals("RetentionPolicy.SOURCE", name)
- }
- }
- }
- }
- }
- }
-
@Test fun notOpenClass() {
- verifyModel("testdata/classes/notOpenClass.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/notOpenClass.kt", defaultModelConfig) { model ->
with(model.members.single().members.first { it.name == "D"}.members.first { it.name == "f" }) {
val modifiers = details(NodeKind.Modifier)
assertEquals(2, modifiers.size)
@@ -232,7 +205,7 @@ class ClassTest {
}
@Test fun indirectOverride() {
- verifyModel("testdata/classes/indirectOverride.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/indirectOverride.kt", defaultModelConfig) { model ->
with(model.members.single().members.first { it.name == "E"}.members.first { it.name == "foo" }) {
val modifiers = details(NodeKind.Modifier)
assertEquals(2, modifiers.size)
@@ -245,7 +218,7 @@ class ClassTest {
}
@Test fun innerClass() {
- verifyPackageMember("testdata/classes/innerClass.kt") { cls ->
+ verifyPackageMember("testdata/classes/innerClass.kt", defaultModelConfig) { cls ->
val innerClass = cls.members.single { it.name == "D" }
val modifiers = innerClass.details(NodeKind.Modifier)
assertEquals(3, modifiers.size)
@@ -254,7 +227,7 @@ class ClassTest {
}
@Test fun companionObjectExtension() {
- verifyModel("testdata/classes/companionObjectExtension.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/companionObjectExtension.kt", defaultModelConfig) { model ->
val pkg = model.members.single()
val cls = pkg.members.single { it.name == "Foo" }
val extensions = cls.extensions.filter { it.kind == NodeKind.CompanionObjectProperty }
@@ -263,7 +236,7 @@ class ClassTest {
}
@Test fun secondaryConstructor() {
- verifyPackageMember("testdata/classes/secondaryConstructor.kt") { cls ->
+ verifyPackageMember("testdata/classes/secondaryConstructor.kt", defaultModelConfig) { cls ->
val constructors = cls.members(NodeKind.Constructor)
assertEquals(2, constructors.size)
with (constructors.first { it.details(NodeKind.Parameter).size == 1}) {
@@ -274,7 +247,7 @@ class ClassTest {
}
@Test fun sinceKotlin() {
- verifyModel("testdata/classes/sinceKotlin.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/classes/sinceKotlin.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(listOf("Kotlin 1.1"), platforms)
}
@@ -282,7 +255,10 @@ class ClassTest {
}
@Test fun privateCompanionObject() {
- verifyModel("testdata/classes/privateCompanionObject.kt", includeNonPublic = false) { model ->
+ checkSourceExistsAndVerifyModel(
+ "testdata/classes/privateCompanionObject.kt",
+ modelConfig = ModelConfig(analysisPlatform = analysisPlatform, includeNonPublic = false)
+ ) { model ->
with(model.members.single().members.single()) {
assertEquals(0, members(NodeKind.CompanionObjectFunction).size)
assertEquals(0, members(NodeKind.CompanionObjectProperty).size)
diff --git a/core/src/test/kotlin/model/PropertyTest.kt b/core/src/test/kotlin/model/BasePropertyTest.kt
index 0ee0e0f5..c88fe702 100644
--- a/core/src/test/kotlin/model/PropertyTest.kt
+++ b/core/src/test/kotlin/model/BasePropertyTest.kt
@@ -1,15 +1,15 @@
package org.jetbrains.dokka.tests
-import org.jetbrains.dokka.Content
-import org.jetbrains.dokka.NodeKind
-import org.jetbrains.dokka.RefKind
+import org.jetbrains.dokka.*
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
-class PropertyTest {
+abstract class BasePropertyTest(val analysisPlatform: Platform) {
+
+ protected val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform)
@Test fun valueProperty() {
- verifyModel("testdata/properties/valueProperty.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/valueProperty.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("property", name)
assertEquals(NodeKind.Property, kind)
@@ -22,7 +22,7 @@ class PropertyTest {
}
@Test fun variableProperty() {
- verifyModel("testdata/properties/variableProperty.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/variableProperty.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("property", name)
assertEquals(NodeKind.Property, kind)
@@ -35,7 +35,7 @@ class PropertyTest {
}
@Test fun valuePropertyWithGetter() {
- verifyModel("testdata/properties/valuePropertyWithGetter.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/valuePropertyWithGetter.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("property", name)
assertEquals(NodeKind.Property, kind)
@@ -48,7 +48,7 @@ class PropertyTest {
}
@Test fun variablePropertyWithAccessors() {
- verifyModel("testdata/properties/variablePropertyWithAccessors.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/variablePropertyWithAccessors.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("property", name)
assertEquals(NodeKind.Property, kind)
@@ -64,21 +64,11 @@ class PropertyTest {
}
}
- @Test fun annotatedProperty() {
- verifyModel("testdata/properties/annotatedProperty.kt", withKotlinRuntime = true) { model ->
- with(model.members.single().members.single()) {
- assertEquals(1, annotations.count())
- with(annotations[0]) {
- assertEquals("Volatile", name)
- assertEquals(Content.Empty, content)
- assertEquals(NodeKind.Annotation, kind)
- }
- }
- }
- }
-
@Test fun propertyWithReceiver() {
- verifyModel("testdata/properties/propertyWithReceiver.kt") { model ->
+ checkSourceExistsAndVerifyModel(
+ "testdata/properties/propertyWithReceiver.kt",
+ defaultModelConfig
+ ) { model ->
with(model.members.single().members.single()) {
assertEquals("kotlin.String", name)
assertEquals(NodeKind.ExternalClass, kind)
@@ -91,7 +81,7 @@ class PropertyTest {
}
@Test fun propertyOverride() {
- verifyModel("testdata/properties/propertyOverride.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/propertyOverride.kt", defaultModelConfig) { model ->
with(model.members.single().members.single { it.name == "Bar" }.members.single { it.name == "xyzzy"}) {
assertEquals("xyzzy", name)
val override = references(RefKind.Override).single().to
@@ -102,7 +92,7 @@ class PropertyTest {
}
@Test fun sinceKotlin() {
- verifyModel("testdata/properties/sinceKotlin.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/properties/sinceKotlin.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(listOf("Kotlin 1.1"), platforms)
}
diff --git a/core/src/test/kotlin/model/CommentTest.kt b/core/src/test/kotlin/model/CommentTest.kt
index 3752bb8c..a97c55eb 100644
--- a/core/src/test/kotlin/model/CommentTest.kt
+++ b/core/src/test/kotlin/model/CommentTest.kt
@@ -7,7 +7,7 @@ import org.jetbrains.dokka.*
public class CommentTest {
@Test fun codeBlockComment() {
- verifyModel("testdata/comments/codeBlockComment.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/codeBlockComment.kt") { model ->
with(model.members.single().members.first()) {
assertEqualsIgnoringSeparators("""[code lang=brainfuck]
|
@@ -30,7 +30,7 @@ public class CommentTest {
}
@Test fun emptyDoc() {
- verifyModel("testdata/comments/emptyDoc.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/emptyDoc.kt") { model ->
with(model.members.single().members.single()) {
assertEquals(Content.Empty, content)
}
@@ -38,7 +38,7 @@ public class CommentTest {
}
@Test fun emptyDocButComment() {
- verifyModel("testdata/comments/emptyDocButComment.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/emptyDocButComment.kt") { model ->
with(model.members.single().members.single()) {
assertEquals(Content.Empty, content)
}
@@ -46,7 +46,7 @@ public class CommentTest {
}
@Test fun multilineDoc() {
- verifyModel("testdata/comments/multilineDoc.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/multilineDoc.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("doc1", content.summary.toTestString())
assertEquals("doc2\ndoc3", content.description.toTestString())
@@ -55,7 +55,7 @@ public class CommentTest {
}
@Test fun multilineDocWithComment() {
- verifyModel("testdata/comments/multilineDocWithComment.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/multilineDocWithComment.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("doc1", content.summary.toTestString())
assertEquals("doc2\ndoc3", content.description.toTestString())
@@ -64,7 +64,7 @@ public class CommentTest {
}
@Test fun oneLineDoc() {
- verifyModel("testdata/comments/oneLineDoc.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/oneLineDoc.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("doc", content.summary.toTestString())
}
@@ -72,7 +72,7 @@ public class CommentTest {
}
@Test fun oneLineDocWithComment() {
- verifyModel("testdata/comments/oneLineDocWithComment.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/oneLineDocWithComment.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("doc", content.summary.toTestString())
}
@@ -80,7 +80,7 @@ public class CommentTest {
}
@Test fun oneLineDocWithEmptyLine() {
- verifyModel("testdata/comments/oneLineDocWithEmptyLine.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/oneLineDocWithEmptyLine.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("doc", content.summary.toTestString())
}
@@ -88,7 +88,7 @@ public class CommentTest {
}
@Test fun emptySection() {
- verifyModel("testdata/comments/emptySection.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/emptySection.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
assertEquals(1, content.sections.count())
@@ -101,7 +101,7 @@ public class CommentTest {
}
@Test fun quotes() {
- verifyModel("testdata/comments/quotes.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/quotes.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("it's \"useful\"", content.summary.toTestString())
}
@@ -109,7 +109,7 @@ public class CommentTest {
}
@Test fun section1() {
- verifyModel("testdata/comments/section1.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/section1.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
assertEquals(1, content.sections.count())
@@ -122,7 +122,7 @@ public class CommentTest {
}
@Test fun section2() {
- verifyModel("testdata/comments/section2.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/section2.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
assertEquals(2, content.sections.count())
@@ -139,7 +139,7 @@ public class CommentTest {
}
@Test fun multilineSection() {
- verifyModel("testdata/comments/multilineSection.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/multilineSection.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
assertEquals(1, content.sections.count())
@@ -153,7 +153,7 @@ line two""", toTestString())
}
@Test fun directive() {
- verifyModel("testdata/comments/directive.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/comments/directive.kt") { model ->
with(model.members.single().members.first()) {
assertEquals("Summary", content.summary.toTestString())
with (content.description) {
diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt
index 32910682..2704bf65 100644
--- a/core/src/test/kotlin/model/FunctionTest.kt
+++ b/core/src/test/kotlin/model/FunctionTest.kt
@@ -2,14 +2,16 @@ 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.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
-import kotlin.test.assertNotNull
-class FunctionTest {
+abstract class BaseFunctionTest(val analysisPlatform: Platform) {
+ protected val defaultModelConfig = ModelConfig(analysisPlatform = analysisPlatform)
@Test fun function() {
- verifyModel("testdata/functions/function.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/function.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("fn", name)
assertEquals(NodeKind.Function, kind)
@@ -22,7 +24,7 @@ class FunctionTest {
}
@Test fun functionWithReceiver() {
- verifyModel("testdata/functions/functionWithReceiver.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/functionWithReceiver.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("kotlin.String", name)
assertEquals(NodeKind.ExternalClass, kind)
@@ -54,7 +56,7 @@ class FunctionTest {
}
@Test fun genericFunction() {
- verifyModel("testdata/functions/genericFunction.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/genericFunction.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("generic", name)
assertEquals(NodeKind.Function, kind)
@@ -78,7 +80,7 @@ class FunctionTest {
}
}
@Test fun genericFunctionWithConstraints() {
- verifyModel("testdata/functions/genericFunctionWithConstraints.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/genericFunctionWithConstraints.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("generic", name)
assertEquals(NodeKind.Function, kind)
@@ -118,7 +120,7 @@ class FunctionTest {
}
@Test fun functionWithParams() {
- verifyModel("testdata/functions/functionWithParams.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/functionWithParams.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals("function", name)
assertEquals(NodeKind.Function, kind)
@@ -143,32 +145,21 @@ Documentation""", content.description.toTestString())
}
}
- @Test fun annotatedFunction() {
- verifyPackageMember("testdata/functions/annotatedFunction.kt", withKotlinRuntime = true) { func ->
- assertEquals(1, func.annotations.count())
- with(func.annotations[0]) {
- assertEquals("Strictfp", name)
- assertEquals(Content.Empty, content)
- assertEquals(NodeKind.Annotation, kind)
- }
- }
- }
-
@Test fun functionWithNotDocumentedAnnotation() {
- verifyPackageMember("testdata/functions/functionWithNotDocumentedAnnotation.kt") { func ->
+ verifyPackageMember("testdata/functions/functionWithNotDocumentedAnnotation.kt", defaultModelConfig) { func ->
assertEquals(0, func.annotations.count())
}
}
@Test fun inlineFunction() {
- verifyPackageMember("testdata/functions/inlineFunction.kt") { func ->
+ verifyPackageMember("testdata/functions/inlineFunction.kt", defaultModelConfig) { func ->
val modifiers = func.details(NodeKind.Modifier).map { it.name }
assertTrue("inline" in modifiers)
}
}
@Test fun functionWithAnnotatedParam() {
- verifyModel("testdata/functions/functionWithAnnotatedParam.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/functionWithAnnotatedParam.kt", defaultModelConfig) { model ->
with(model.members.single().members.single { it.name == "function" }) {
with(details(NodeKind.Parameter).first()) {
assertEquals(1, annotations.count())
@@ -183,7 +174,7 @@ Documentation""", content.description.toTestString())
}
@Test fun functionWithNoinlineParam() {
- verifyPackageMember("testdata/functions/functionWithNoinlineParam.kt") { func ->
+ verifyPackageMember("testdata/functions/functionWithNoinlineParam.kt", defaultModelConfig) { func ->
with(func.details(NodeKind.Parameter).first()) {
val modifiers = details(NodeKind.Modifier).map { it.name }
assertTrue("noinline" in modifiers)
@@ -192,7 +183,10 @@ Documentation""", content.description.toTestString())
}
@Test fun annotatedFunctionWithAnnotationParameters() {
- verifyModel("testdata/functions/annotatedFunctionWithAnnotationParameters.kt") { model ->
+ checkSourceExistsAndVerifyModel(
+ "testdata/functions/annotatedFunctionWithAnnotationParameters.kt",
+ defaultModelConfig
+ ) { model ->
with(model.members.single().members.single { it.name == "f" }) {
assertEquals(1, annotations.count())
with(annotations[0]) {
@@ -214,7 +208,7 @@ Documentation""", content.description.toTestString())
}
@Test fun functionWithDefaultParameter() {
- verifyModel("testdata/functions/functionWithDefaultParameter.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/functionWithDefaultParameter.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
with(details.elementAt(3)) {
val value = details(NodeKind.Value)
@@ -228,7 +222,7 @@ Documentation""", content.description.toTestString())
}
@Test fun sinceKotlin() {
- verifyModel("testdata/functions/sinceKotlin.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/functions/sinceKotlin.kt", defaultModelConfig) { model ->
with(model.members.single().members.single()) {
assertEquals(listOf("Kotlin 1.1"), platforms)
}
diff --git a/core/src/test/kotlin/model/JSClassTest.kt b/core/src/test/kotlin/model/JSClassTest.kt
new file mode 100644
index 00000000..e39b95cc
--- /dev/null
+++ b/core/src/test/kotlin/model/JSClassTest.kt
@@ -0,0 +1,6 @@
+package org.jetbrains.dokka.tests.model
+
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BaseClassTest
+
+class JSClassTest: BaseClassTest(Platform.js) {} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JSFunctionTest.kt b/core/src/test/kotlin/model/JSFunctionTest.kt
new file mode 100644
index 00000000..f6b987a9
--- /dev/null
+++ b/core/src/test/kotlin/model/JSFunctionTest.kt
@@ -0,0 +1,8 @@
+package org.jetbrains.dokka.tests.model
+
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BaseFunctionTest
+
+class JSFunctionTest: BaseFunctionTest(Platform.js) {
+
+} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JSPropertyTest.kt b/core/src/test/kotlin/model/JSPropertyTest.kt
new file mode 100644
index 00000000..0193d899
--- /dev/null
+++ b/core/src/test/kotlin/model/JSPropertyTest.kt
@@ -0,0 +1,8 @@
+package org.jetbrains.dokka.tests.model
+
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BasePropertyTest
+
+class JSPropertyTest: BasePropertyTest(Platform.js) {
+
+} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JVMClassTest.kt b/core/src/test/kotlin/model/JVMClassTest.kt
new file mode 100644
index 00000000..22e23722
--- /dev/null
+++ b/core/src/test/kotlin/model/JVMClassTest.kt
@@ -0,0 +1,55 @@
+package org.jetbrains.dokka.tests.model
+
+import org.jetbrains.dokka.Content
+import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BaseClassTest
+import org.jetbrains.dokka.tests.ModelConfig
+import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel
+import org.jetbrains.dokka.tests.verifyPackageMember
+import org.junit.Assert
+import org.junit.Test
+
+class JVMClassTest: BaseClassTest(Platform.jvm) {
+ @Test
+ fun annotatedClass() {
+ verifyPackageMember("testdata/classes/annotatedClass.kt", ModelConfig(
+ analysisPlatform = analysisPlatform,
+ withKotlinRuntime = true
+ )
+ ) { cls ->
+ Assert.assertEquals(1, cls.annotations.count())
+ with(cls.annotations[0]) {
+ Assert.assertEquals("Strictfp", name)
+ Assert.assertEquals(Content.Empty, content)
+ Assert.assertEquals(NodeKind.Annotation, kind)
+ }
+ }
+ }
+
+
+ @Test fun javaAnnotationClass() {
+ checkSourceExistsAndVerifyModel(
+ "testdata/classes/javaAnnotationClass.kt",
+ modelConfig = ModelConfig(analysisPlatform = analysisPlatform, withJdk = true)
+ ) { model ->
+ with(model.members.single().members.single()) {
+ Assert.assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ Assert.assertEquals("Retention", name)
+ Assert.assertEquals(Content.Empty, content)
+ Assert.assertEquals(NodeKind.Annotation, kind)
+ with(details[0]) {
+ Assert.assertEquals(NodeKind.Parameter, kind)
+ Assert.assertEquals(1, details.count())
+ with(details[0]) {
+ Assert.assertEquals(NodeKind.Value, kind)
+ Assert.assertEquals("RetentionPolicy.SOURCE", name)
+ }
+ }
+ }
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JVMFunctionTest.kt b/core/src/test/kotlin/model/JVMFunctionTest.kt
new file mode 100644
index 00000000..a2fb0d2a
--- /dev/null
+++ b/core/src/test/kotlin/model/JVMFunctionTest.kt
@@ -0,0 +1,29 @@
+package org.jetbrains.dokka.tests.model
+
+import com.sun.tools.javac.util.BaseFileManager
+import org.jetbrains.dokka.Content
+import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BaseFunctionTest
+import org.jetbrains.dokka.tests.ModelConfig
+import org.jetbrains.dokka.tests.verifyPackageMember
+import org.junit.Assert
+import org.junit.Test
+
+class JVMFunctionTest: BaseFunctionTest(Platform.jvm) {
+ @Test
+ fun annotatedFunction() {
+ verifyPackageMember("testdata/functions/annotatedFunction.kt", ModelConfig(
+ analysisPlatform = Platform.jvm,
+ withKotlinRuntime = true
+ )) { func ->
+ Assert.assertEquals(1, func.annotations.count())
+ with(func.annotations[0]) {
+ Assert.assertEquals("Strictfp", name)
+ Assert.assertEquals(Content.Empty, content)
+ Assert.assertEquals(NodeKind.Annotation, kind)
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JVMPropertyTest.kt b/core/src/test/kotlin/model/JVMPropertyTest.kt
new file mode 100644
index 00000000..182dedbe
--- /dev/null
+++ b/core/src/test/kotlin/model/JVMPropertyTest.kt
@@ -0,0 +1,33 @@
+package org.jetbrains.dokka.tests.model
+
+import org.jetbrains.dokka.Content
+import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
+import org.jetbrains.dokka.tests.BasePropertyTest
+import org.jetbrains.dokka.tests.ModelConfig
+import org.jetbrains.dokka.tests.checkSourceExistsAndVerifyModel
+import org.junit.Assert
+import org.junit.Test
+
+class JVMPropertyTest : BasePropertyTest(Platform.jvm) {
+ @Test
+ fun annotatedProperty() {
+ checkSourceExistsAndVerifyModel(
+ "testdata/properties/annotatedProperty.kt",
+ modelConfig = ModelConfig(
+ analysisPlatform = analysisPlatform,
+ withKotlinRuntime = true
+ )
+ ) { model ->
+ with(model.members.single().members.single()) {
+ Assert.assertEquals(1, annotations.count())
+ with(annotations[0]) {
+ Assert.assertEquals("Volatile", name)
+ Assert.assertEquals(Content.Empty, content)
+ Assert.assertEquals(NodeKind.Annotation, kind)
+ }
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/core/src/test/kotlin/model/JavaTest.kt b/core/src/test/kotlin/model/JavaTest.kt
index e6c22ee4..946abcad 100644
--- a/core/src/test/kotlin/model/JavaTest.kt
+++ b/core/src/test/kotlin/model/JavaTest.kt
@@ -1,14 +1,16 @@
package org.jetbrains.dokka.tests
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.RefKind
import org.junit.Assert.*
import org.junit.Ignore
import org.junit.Test
public class JavaTest {
+ private val defaultModelConfig = ModelConfig(analysisPlatform = Platform.jvm)
@Test fun function() {
- verifyJavaPackageMember("testdata/java/member.java") { cls ->
+ verifyJavaPackageMember("testdata/java/member.java", defaultModelConfig) { cls ->
assertEquals("Test", cls.name)
assertEquals(NodeKind.Class, cls.kind)
with(cls.members(NodeKind.Function).single()) {
@@ -45,7 +47,7 @@ public class JavaTest {
}
@Test fun memberWithModifiers() {
- verifyJavaPackageMember("testdata/java/memberWithModifiers.java") { cls ->
+ verifyJavaPackageMember("testdata/java/memberWithModifiers.java", defaultModelConfig) { cls ->
val modifiers = cls.details(NodeKind.Modifier).map { it.name }
assertTrue("abstract" in modifiers)
with(cls.members.single { it.name == "fn" }) {
@@ -58,7 +60,7 @@ public class JavaTest {
}
@Test fun superClass() {
- verifyJavaPackageMember("testdata/java/superClass.java") { cls ->
+ verifyJavaPackageMember("testdata/java/superClass.java", defaultModelConfig) { cls ->
val superTypes = cls.details(NodeKind.Supertype)
assertEquals(2, superTypes.size)
assertEquals("Exception", superTypes[0].name)
@@ -67,7 +69,7 @@ public class JavaTest {
}
@Test fun arrayType() {
- verifyJavaPackageMember("testdata/java/arrayType.java") { cls ->
+ verifyJavaPackageMember("testdata/java/arrayType.java", defaultModelConfig) { cls ->
with(cls.members(NodeKind.Function).single()) {
val type = detail(NodeKind.Type)
assertEquals("Array", type.name)
@@ -81,7 +83,7 @@ public class JavaTest {
}
@Test fun typeParameter() {
- verifyJavaPackageMember("testdata/java/typeParameter.java") { cls ->
+ verifyJavaPackageMember("testdata/java/typeParameter.java", defaultModelConfig) { cls ->
val typeParameters = cls.details(NodeKind.TypeParameter)
with(typeParameters.single()) {
assertEquals("T", name)
@@ -100,7 +102,7 @@ public class JavaTest {
}
@Test fun constructors() {
- verifyJavaPackageMember("testdata/java/constructors.java") { cls ->
+ verifyJavaPackageMember("testdata/java/constructors.java", defaultModelConfig) { cls ->
val constructors = cls.members(NodeKind.Constructor)
assertEquals(2, constructors.size)
with(constructors[0]) {
@@ -110,14 +112,14 @@ public class JavaTest {
}
@Test fun innerClass() {
- verifyJavaPackageMember("testdata/java/InnerClass.java") { cls ->
+ verifyJavaPackageMember("testdata/java/InnerClass.java", defaultModelConfig) { cls ->
val innerClass = cls.members(NodeKind.Class).single()
assertEquals("D", innerClass.name)
}
}
@Test fun varargs() {
- verifyJavaPackageMember("testdata/java/varargs.java") { cls ->
+ verifyJavaPackageMember("testdata/java/varargs.java", defaultModelConfig) { cls ->
val fn = cls.members(NodeKind.Function).single()
val param = fn.detail(NodeKind.Parameter)
assertEquals("vararg", param.details(NodeKind.Modifier).first().name)
@@ -128,7 +130,7 @@ public class JavaTest {
}
@Test fun fields() {
- verifyJavaPackageMember("testdata/java/field.java") { cls ->
+ verifyJavaPackageMember("testdata/java/field.java", defaultModelConfig) { cls ->
val i = cls.members(NodeKind.Property).single { it.name == "i" }
assertEquals("Int", i.detail(NodeKind.Type).name)
assertTrue("var" in i.details(NodeKind.Modifier).map { it.name })
@@ -141,7 +143,7 @@ public class JavaTest {
}
@Test fun staticMethod() {
- verifyJavaPackageMember("testdata/java/staticMethod.java") { cls ->
+ verifyJavaPackageMember("testdata/java/staticMethod.java", defaultModelConfig) { cls ->
val m = cls.members(NodeKind.Function).single { it.name == "foo" }
assertTrue("static" in m.details(NodeKind.Modifier).map { it.name })
}
@@ -154,13 +156,13 @@ public class JavaTest {
* Proposed tag `@exclude` for it, but not supported yet
*/
@Ignore("@suppress not supported in Java!") @Test fun suppressTag() {
- verifyJavaPackageMember("testdata/java/suppressTag.java") { cls ->
+ verifyJavaPackageMember("testdata/java/suppressTag.java", defaultModelConfig) { cls ->
assertEquals(1, cls.members(NodeKind.Function).size)
}
}
@Test fun annotatedAnnotation() {
- verifyJavaPackageMember("testdata/java/annotatedAnnotation.java") { cls ->
+ verifyJavaPackageMember("testdata/java/annotatedAnnotation.java", defaultModelConfig) { cls ->
assertEquals(1, cls.annotations.size)
with(cls.annotations[0]) {
assertEquals(1, details.count())
@@ -177,21 +179,21 @@ public class JavaTest {
}
@Test fun deprecation() {
- verifyJavaPackageMember("testdata/java/deprecation.java") { cls ->
+ verifyJavaPackageMember("testdata/java/deprecation.java", defaultModelConfig) { cls ->
val fn = cls.members(NodeKind.Function).single()
assertEquals("This should no longer be used", fn.deprecation!!.content.toTestString())
}
}
@Test fun javaLangObject() {
- verifyJavaPackageMember("testdata/java/javaLangObject.java") { cls ->
+ verifyJavaPackageMember("testdata/java/javaLangObject.java", defaultModelConfig) { cls ->
val fn = cls.members(NodeKind.Function).single()
assertEquals("Any", fn.detail(NodeKind.Type).name)
}
}
@Test fun enumValues() {
- verifyJavaPackageMember("testdata/java/enumValues.java") { cls ->
+ verifyJavaPackageMember("testdata/java/enumValues.java", defaultModelConfig) { cls ->
val superTypes = cls.details(NodeKind.Supertype)
assertEquals(0, superTypes.size)
assertEquals(1, cls.members(NodeKind.EnumItem).size)
@@ -199,7 +201,7 @@ public class JavaTest {
}
@Test fun inheritorLinks() {
- verifyJavaPackageMember("testdata/java/InheritorLinks.java") { cls ->
+ verifyJavaPackageMember("testdata/java/InheritorLinks.java", defaultModelConfig) { cls ->
val fooClass = cls.members.single { it.name == "Foo" }
val inheritors = fooClass.references(RefKind.Inheritor)
assertEquals(1, inheritors.size)
diff --git a/core/src/test/kotlin/model/KotlinAsJavaTest.kt b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
index d24d8bdd..1d95556f 100644
--- a/core/src/test/kotlin/model/KotlinAsJavaTest.kt
+++ b/core/src/test/kotlin/model/KotlinAsJavaTest.kt
@@ -2,10 +2,13 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.DocumentationModule
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.Platform
import org.junit.Test
import org.junit.Assert.assertEquals
class KotlinAsJavaTest {
+ private val defaultModelConfig = ModelConfig (analysisPlatform = Platform.jvm)
+
@Test fun function() {
verifyModelAsJava("testdata/functions/function.kt") { model ->
val pkg = model.members.single()
@@ -33,8 +36,13 @@ fun verifyModelAsJava(source: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
verifier: (DocumentationModule) -> Unit) {
- verifyModel(source,
- withJdk = withJdk, withKotlinRuntime = withKotlinRuntime,
+ checkSourceExistsAndVerifyModel(
+ source,
+ modelConfig = ModelConfig(
+ withJdk = withJdk,
+ withKotlinRuntime = withKotlinRuntime,
format = "html-as-java",
- verifier = verifier)
+ analysisPlatform = Platform.jvm),
+ verifier = verifier
+ )
}
diff --git a/core/src/test/kotlin/model/LinkTest.kt b/core/src/test/kotlin/model/LinkTest.kt
index 6b72525f..d7283bae 100644
--- a/core/src/test/kotlin/model/LinkTest.kt
+++ b/core/src/test/kotlin/model/LinkTest.kt
@@ -8,7 +8,7 @@ import org.junit.Test
class LinkTest {
@Test fun linkToSelf() {
- verifyModel("testdata/links/linkToSelf.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToSelf.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -18,7 +18,7 @@ class LinkTest {
}
@Test fun linkToMember() {
- verifyModel("testdata/links/linkToMember.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToMember.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -28,7 +28,7 @@ class LinkTest {
}
@Test fun linkToConstantWithUnderscores() {
- verifyModel("testdata/links/linkToConstantWithUnderscores.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToConstantWithUnderscores.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -38,7 +38,7 @@ class LinkTest {
}
@Test fun linkToQualifiedMember() {
- verifyModel("testdata/links/linkToQualifiedMember.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToQualifiedMember.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Class, kind)
@@ -48,7 +48,7 @@ class LinkTest {
}
@Test fun linkToParam() {
- verifyModel("testdata/links/linkToParam.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToParam.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Foo", name)
assertEquals(NodeKind.Function, kind)
@@ -58,7 +58,7 @@ class LinkTest {
}
@Test fun linkToPackage() {
- verifyModel("testdata/links/linkToPackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/links/linkToPackage.kt") { model ->
val packageNode = model.members.single()
with(packageNode) {
assertEquals(this.name, "test.magic")
diff --git a/core/src/test/kotlin/model/PackageTest.kt b/core/src/test/kotlin/model/PackageTest.kt
index 052f0d28..bc8a0e0d 100644
--- a/core/src/test/kotlin/model/PackageTest.kt
+++ b/core/src/test/kotlin/model/PackageTest.kt
@@ -9,7 +9,7 @@ import org.junit.Test
public class PackageTest {
@Test fun rootPackage() {
- verifyModel("testdata/packages/rootPackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/rootPackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("", name)
@@ -22,7 +22,7 @@ public class PackageTest {
}
@Test fun simpleNamePackage() {
- verifyModel("testdata/packages/simpleNamePackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/simpleNamePackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("simple", name)
@@ -35,7 +35,7 @@ public class PackageTest {
}
@Test fun dottedNamePackage() {
- verifyModel("testdata/packages/dottedNamePackage.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/packages/dottedNamePackage.kt") { model ->
with(model.members.single()) {
assertEquals(NodeKind.Package, kind)
assertEquals("dot.name", name)
@@ -48,8 +48,14 @@ public class PackageTest {
}
@Test fun multipleFiles() {
- verifyModel(KotlinSourceRoot("testdata/packages/dottedNamePackage.kt"),
- KotlinSourceRoot("testdata/packages/simpleNamePackage.kt")) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(
+ KotlinSourceRoot("testdata/packages/dottedNamePackage.kt"),
+ KotlinSourceRoot("testdata/packages/simpleNamePackage.kt")
+ )
+ )
+ ) { model ->
assertEquals(2, model.members.count())
with(model.members.single { it.name == "simple" }) {
assertEquals(NodeKind.Package, kind)
@@ -70,8 +76,14 @@ public class PackageTest {
}
@Test fun multipleFilesSamePackage() {
- verifyModel(KotlinSourceRoot("testdata/packages/simpleNamePackage.kt"),
- KotlinSourceRoot("testdata/packages/simpleNamePackage2.kt")) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(
+ KotlinSourceRoot("testdata/packages/simpleNamePackage.kt"),
+ KotlinSourceRoot("testdata/packages/simpleNamePackage2.kt")
+ )
+ )
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)
@@ -85,7 +97,9 @@ public class PackageTest {
}
@Test fun classAtPackageLevel() {
- verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt")) { model ->
+ verifyModel(
+ ModelConfig(roots = arrayOf(KotlinSourceRoot("testdata/packages/classInPackage.kt")))
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)
@@ -99,8 +113,14 @@ public class PackageTest {
}
@Test fun suppressAtPackageLevel() {
- verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt"),
- perPackageOptions = listOf(PackageOptionsImpl(prefix = "simple.name", suppress = true))) { model ->
+ verifyModel(
+ ModelConfig(
+ roots = arrayOf(KotlinSourceRoot("testdata/packages/classInPackage.kt")),
+ perPackageOptions = listOf(
+ PackageOptionsImpl(prefix = "simple.name", suppress = true)
+ )
+ )
+ ) { model ->
assertEquals(1, model.members.count())
with(model.members.elementAt(0)) {
assertEquals(NodeKind.Package, kind)
diff --git a/core/src/test/kotlin/model/TypeAliasTest.kt b/core/src/test/kotlin/model/TypeAliasTest.kt
index c653ac83..a011b44f 100644
--- a/core/src/test/kotlin/model/TypeAliasTest.kt
+++ b/core/src/test/kotlin/model/TypeAliasTest.kt
@@ -8,7 +8,7 @@ import org.junit.Test
class TypeAliasTest {
@Test
fun testSimple() {
- verifyModel("testdata/typealias/simple.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/simple.kt") {
val pkg = it.members.single()
with(pkg.member(NodeKind.TypeAlias)) {
assertEquals(Content.Empty, content)
@@ -20,7 +20,7 @@ class TypeAliasTest {
@Test
fun testInheritanceFromTypeAlias() {
- verifyModel("testdata/typealias/inheritanceFromTypeAlias.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/inheritanceFromTypeAlias.kt") {
val pkg = it.members.single()
with(pkg.member(NodeKind.TypeAlias)) {
assertEquals(Content.Empty, content)
@@ -36,7 +36,7 @@ class TypeAliasTest {
@Test
fun testChain() {
- verifyModel("testdata/typealias/chain.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/chain.kt") {
val pkg = it.members.single()
with(pkg.members(NodeKind.TypeAlias).find { it.name == "B" }!!) {
assertEquals(Content.Empty, content)
@@ -51,7 +51,7 @@ class TypeAliasTest {
@Test
fun testDocumented() {
- verifyModel("testdata/typealias/documented.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/documented.kt") {
val pkg = it.members.single()
with(pkg.member(NodeKind.TypeAlias)) {
assertEquals("Just typealias", content.summary.toTestString())
@@ -61,7 +61,7 @@ class TypeAliasTest {
@Test
fun testDeprecated() {
- verifyModel("testdata/typealias/deprecated.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/deprecated.kt") {
val pkg = it.members.single()
with(pkg.member(NodeKind.TypeAlias)) {
assertEquals(Content.Empty, content)
@@ -73,7 +73,7 @@ class TypeAliasTest {
@Test
fun testGeneric() {
- verifyModel("testdata/typealias/generic.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/generic.kt") {
val pkg = it.members.single()
with(pkg.members(NodeKind.TypeAlias).find { it.name == "B" }!!) {
assertEquals("Any", detail(NodeKind.TypeAliasUnderlyingType).detail(NodeKind.Type).name)
@@ -88,7 +88,7 @@ class TypeAliasTest {
@Test
fun testFunctional() {
- verifyModel("testdata/typealias/functional.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/functional.kt") {
val pkg = it.members.single()
with(pkg.member(NodeKind.TypeAlias)) {
assertEquals("Function1", detail(NodeKind.TypeAliasUnderlyingType).name)
@@ -105,7 +105,7 @@ class TypeAliasTest {
@Test
fun testAsTypeBoundWithVariance() {
- verifyModel("testdata/typealias/asTypeBoundWithVariance.kt") {
+ checkSourceExistsAndVerifyModel("testdata/typealias/asTypeBoundWithVariance.kt") {
val pkg = it.members.single()
with(pkg.members(NodeKind.Class).find { it.name == "C" }!!) {
val tParam = detail(NodeKind.TypeParameter)
@@ -123,7 +123,7 @@ class TypeAliasTest {
@Test
fun sinceKotlin() {
- verifyModel("testdata/typealias/sinceKotlin.kt") { model ->
+ checkSourceExistsAndVerifyModel("testdata/typealias/sinceKotlin.kt") { model ->
with(model.members.single().members.single()) {
assertEquals(listOf("Kotlin 1.1"), platforms)
}