aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/linkResolvers
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-10-29 11:46:04 +0100
committerKamil Doległo <kamilok1965@interia.pl>2019-10-29 15:49:53 +0100
commit14a290009098b777521b1dedb551047fb66ba73b (patch)
treeae68219051b080ff8888308d5521aaeea7431fb4 /core/src/test/kotlin/linkResolvers
parent5f358199788fefb78f5db7791e718480793a77fc (diff)
downloaddokka-14a290009098b777521b1dedb551047fb66ba73b.tar.gz
dokka-14a290009098b777521b1dedb551047fb66ba73b.tar.bz2
dokka-14a290009098b777521b1dedb551047fb66ba73b.zip
[WIP] new model
Diffstat (limited to 'core/src/test/kotlin/linkResolvers')
-rw-r--r--core/src/test/kotlin/linkResolvers/LinkResolverTest.kt92
1 files changed, 92 insertions, 0 deletions
diff --git a/core/src/test/kotlin/linkResolvers/LinkResolverTest.kt b/core/src/test/kotlin/linkResolvers/LinkResolverTest.kt
new file mode 100644
index 00000000..b2cccce2
--- /dev/null
+++ b/core/src/test/kotlin/linkResolvers/LinkResolverTest.kt
@@ -0,0 +1,92 @@
+package org.jetbrains.dokka.tests.linkResolvers
+//
+//import junit.framework.Assert.assertEquals
+//import org.jetbrains.dokka.testApi.DokkaConfigurationImpl
+//import org.jetbrains.dokka.Platform
+//import org.jetbrains.dokka.links.DRI
+//import org.jetbrains.dokka.pages.*
+//import org.jetbrains.dokka.renderers.FileWriter
+//import org.jetbrains.dokka.renderers.NewHtmlRenderer
+//import org.jetbrains.dokka.resolvers.DefaultLocationProvider
+//import org.junit.Test
+//
+//
+//class LinkResolverTest {
+//
+// fun createModel(): ModulePageNode {
+// val platform = listOf(PlatformData("jvm", Platform.jvm))
+//
+// val moduleSymbol = ContentSymbol(
+// listOf(ContentText("moduleName", platform)),
+// platform)
+//
+// val packageDRI = DRI("packageName")
+//
+// val module = ModulePageNode("",
+// listOf(moduleSymbol, ContentBlock(
+// "packages",
+// listOf(ContentGroup(listOf(ContentLink("packageName", packageDRI, platform)), platform)),
+// platform)
+// ),
+// null)
+//
+// val packageSymbol = ContentSymbol(
+// listOf(ContentText("package moduleName.packageName", platform)),
+// platform)
+//
+// val packageNode = PackagePageNode("packageName", listOf(packageSymbol), module, DRI("packageName"))
+//
+// val classSymbol = ContentSymbol(
+// listOf(ContentText("class ClassName()", platform)),
+// platform)
+//
+// val classNode = ClassPageNode("className", listOf(classSymbol), packageNode, DRI("packageName", "className"))
+//
+// val memberSymbol = ContentSymbol(
+// listOf(ContentText("fun funName(): String", platform)),
+// platform)
+//
+// val memberText = ContentText("This is some docs for funName", platform)
+//
+// val memberNode = MemberPageNode("funName",
+// listOf(memberSymbol, ContentComment(listOf(memberText), platform)),
+// classNode,
+// DRI("packageName", "className", "funName", "..."))
+//
+// module.appendChild(packageNode)
+// packageNode.appendChild(classNode)
+// classNode.appendChild(memberNode)
+// return module
+// }
+//
+// @Test fun memberLink() {
+// val model = createModel()
+// val linkResolver = DefaultLocationProvider(model, DokkaConfigurationImpl())
+// val link = linkResolver.resolve(model.children.first().children.first().children.first())
+// assertEquals("/--root--/package-name/class-name/fun-name", link)
+// }
+//
+// @Test fun classLink() {
+// val model = createModel()
+// val linkResolver = DefaultLocationProvider(model, DokkaConfigurationImpl())
+// val link = linkResolver.resolve(model.children.first().children.first())
+// assertEquals("/--root--/package-name/class-name/index", link)
+// }
+//
+// @Test fun moduleLink() {
+// val model = createModel()
+// val linkResolver = DefaultLocationProvider(model, DokkaConfigurationImpl())
+// val link = linkResolver.resolve(model)
+// assertEquals("/--root--/index", link)
+// }
+//
+// @Test fun writeToFile() {
+// val model = createModel()
+// val linkResolver = DefaultLocationProvider(model, DokkaConfigurationImpl())
+// val fileWriter = FileWriter("/Users/kamildoleglo/IdeaProjects/dokka/build/dokka", ".html")
+// val renderer = NewHtmlRenderer("/Users/kamildoleglo/IdeaProjects/dokka/build/dokka", fileWriter, linkResolver)
+// renderer.render(model)
+// }
+//
+//}
+//