diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-03-13 10:46:33 +0100 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-06-23 02:19:14 +0200 |
commit | 3940153fd08e0c0596ac289766d9ef2877b56591 (patch) | |
tree | ccf7bd66800c512a357ad0e31ca42f8cefcc0dcb /plugins/javadoc/src/test | |
parent | f6530934d36fbb977c2b7c4eb3669a8f581dd9f5 (diff) | |
download | dokka-3940153fd08e0c0596ac289766d9ef2877b56591.tar.gz dokka-3940153fd08e0c0596ac289766d9ef2877b56591.tar.bz2 dokka-3940153fd08e0c0596ac289766d9ef2877b56591.zip |
First version of javadoc output generation
Diffstat (limited to 'plugins/javadoc/src/test')
-rw-r--r-- | plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt | 70 | ||||
-rw-r--r-- | plugins/javadoc/src/test/resources/javadoc/test/main/java/adaptation/Adaptation.kt | 50 |
2 files changed, 120 insertions, 0 deletions
diff --git a/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt new file mode 100644 index 00000000..8a31e596 --- /dev/null +++ b/plugins/javadoc/src/test/kotlin/javadoc/JavadocTest.kt @@ -0,0 +1,70 @@ +package javadoc + +import org.jetbrains.dokka.javadoc.JavadocPlugin +import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Test + +class JavadocTest : AbstractCoreTest() { + + @Test + fun test() { + val config = dokkaConfiguration { + format = "javadoc" + passes { + pass { + sourceRoots = listOf("jvmSrc/") + analysisPlatform = "jvm" + targets = listOf("jvm") + } + } + } + + /* + |/jvmSrc/javadoc/test/Test2.kt + |package javadoc.test + |class Test2() + */ + + testInline(""" + |/jvmSrc/javadoc/Test.kt + |/** + | test + |**/ + |package javadoc + |class Test() : List<Int> + |class Test2() : List<Int> + |/jvmSrc/javadoc/TestJ.java + |package javadoc + |abstract class Test3 extends List<Int> {} + """.trimIndent(), + config, + cleanupOutput = false, + pluginOverrides = listOf(JavadocPlugin()) + ) { + pagesTransformationStage = { + it + } + } + } + +// @Test +// fun test() { +// val config = dokkaConfiguration { +// format = "javadoc" +// passes { +// pass { +// sourceRoots = listOf("main/") +// analysisPlatform = "jvm" +// targets = listOf("jvm") +// } +// } +// } +// testFromData(config, +// cleanupOutput = false, +// pluginOverrides = listOf(JavadocPlugin())) { +// pagesTransformationStage = { +// it +// } +// } +// } +}
\ No newline at end of file diff --git a/plugins/javadoc/src/test/resources/javadoc/test/main/java/adaptation/Adaptation.kt b/plugins/javadoc/src/test/resources/javadoc/test/main/java/adaptation/Adaptation.kt new file mode 100644 index 00000000..6ec3692a --- /dev/null +++ b/plugins/javadoc/src/test/resources/javadoc/test/main/java/adaptation/Adaptation.kt @@ -0,0 +1,50 @@ +package adaptation + +import app.MainApp +import model.InteriorNode +import model.ModelGraph +import org.javatuples.Pair +import transformation.Transformation + +class Adaptation { + private val log: org.apache.log4j.Logger = org.apache.log4j.Logger.getLogger(Adaptation::class.java.name) + fun transform(graph: ModelGraph, transformation: Transformation): Pair<ModelGraph, Boolean> { + return transform(graph, transformation, false) + } + + private fun transform( + graph: ModelGraph, + transformation: Transformation, + prevResult: Boolean + ): Pair<ModelGraph, Boolean> { + var model: ModelGraph = graph + val interiors: Collection<InteriorNode> = graph.getInteriors() + for (i in interiors) { + try { + if (transformation.isConditionCompleted(graph, i)) { + model = transformation.transformGraph(model, i) + log.info( + "Executing transformation: " + transformation.getClass().getSimpleName() + .toString() + " on interior" + i.getId() + ) + Thread.sleep(1000) + return transform(model, transformation, true) + } + } catch (e: Exception) { + log.error( + "Transformation " + transformation.getClass().getSimpleName() + .toString() + " returned an error: " + e.toString() + " for interior: " + i.toString() + ) + } + } + return Pair(model, prevResult) + } + + inner class AdaptationInternalClass internal constructor(var param: Int) { + + inner class AdaptationInternalInternalClass + + } + + class AdaptationInternalStaticClass internal constructor(var param: Int) +}
\ No newline at end of file |