diff options
author | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-12 16:06:54 +0100 |
---|---|---|
committer | Dmitry Jemerov <intelliyole@gmail.com> | 2015-01-12 16:06:54 +0100 |
commit | 49feb9021ca24150257caac4a62af5628f52b6b5 (patch) | |
tree | e5b53761a5338b9931bfe6969cbee988596ec28e /test/src/TestAPI.kt | |
parent | 5f47bc17630ef1457b36054dc8b19011d9d14132 (diff) | |
parent | 23af5e2540aca25ab64deec1821a069f827d7c77 (diff) | |
download | dokka-49feb9021ca24150257caac4a62af5628f52b6b5.tar.gz dokka-49feb9021ca24150257caac4a62af5628f52b6b5.tar.bz2 dokka-49feb9021ca24150257caac4a62af5628f52b6b5.zip |
Merge pull request #9 from orangy/annotations
Support annotation classes and annotations in model and rendered output
Diffstat (limited to 'test/src/TestAPI.kt')
-rw-r--r-- | test/src/TestAPI.kt | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt index cc09f001..e559e337 100644 --- a/test/src/TestAPI.kt +++ b/test/src/TestAPI.kt @@ -4,9 +4,9 @@ import org.jetbrains.jet.cli.common.messages.* import com.intellij.openapi.util.* import kotlin.test.fail import org.jetbrains.dokka.* -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor import java.io.File -import kotlin.test.assertEquals +import com.intellij.openapi.application.PathManager +import org.junit.Assert public fun verifyModel(vararg files: String, verifier: (DocumentationModule) -> Unit) { val messageCollector = object : MessageCollector { @@ -27,6 +27,8 @@ public fun verifyModel(vararg files: String, verifier: (DocumentationModule) -> } val environment = AnalysisEnvironment(messageCollector) { + val stringRoot = PathManager.getResourceRoot(javaClass<String>(), "/java/lang/String.class") + addClasspath(File(stringRoot)) addSources(files.toList()) } @@ -34,10 +36,6 @@ public fun verifyModel(vararg files: String, verifier: (DocumentationModule) -> val documentation = environment.withContext { environment, session -> val fragments = environment.getSourceFiles().map { session.getPackageFragment(it.getPackageFqName()) }.filterNotNull().distinct() - val descriptors = hashMapOf<String, List<DeclarationDescriptor>>() - for ((name, parts) in fragments.groupBy { it.fqName }) { - descriptors.put(name.asString(), parts.flatMap { it.getMemberScope().getAllDescriptors() }) - } val documentationModule = DocumentationModule("test") val documentationBuilder = DocumentationBuilder(session, options) @@ -56,7 +54,7 @@ public fun verifyOutput(path: String, outputExtension: String, outputGenerator: val output = StringBuilder() outputGenerator(it, output) val expectedOutput = File(path.replace(".kt", outputExtension)).readText() - assertEquals(expectedOutput, output.toString()) + Assert.assertEquals(expectedOutput, output.toString()) } } |