diff options
author | Ignat Beresnev <ignat@beresnev.me> | 2021-12-23 14:32:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-23 14:32:18 +0300 |
commit | bfd41ce2a0d43419a671961c19b7d755cffdcfc8 (patch) | |
tree | 00d1fcd75ff7c25de20c8b0621e3bfb11cd3f61a /integration-tests/maven/src/integrationTest/kotlin/org/jetbrains | |
parent | 5c98d42ec08ca1413f920e4f5dde28d330e8837a (diff) | |
download | dokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.tar.gz dokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.tar.bz2 dokka-bfd41ce2a0d43419a671961c19b7d755cffdcfc8.zip |
Introduce documentedVisibilities setting (#2270)
* Introduce `documentedVisibilities` setting
* Remove hardcoded doc generation for Visibility.PUBLIC, correct tests
* Add maven, gradle and cli integration tests for documentedVisibilities
* Fix maven plugin configuration overriding the default value
* Remove test debug prints
* Correct an inconsistency with default values and leave a comment of intentions
* Add a test for visibility of private setter
Diffstat (limited to 'integration-tests/maven/src/integrationTest/kotlin/org/jetbrains')
-rw-r--r-- | integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt b/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt index be70fdb4..0b532057 100644 --- a/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt +++ b/integration-tests/maven/src/integrationTest/kotlin/org/jetbrains/dokka/it/maven/MavenIntegrationTest.kt @@ -4,10 +4,7 @@ import org.jetbrains.dokka.it.AbstractIntegrationTest import org.jetbrains.dokka.it.awaitProcessResult import org.jetbrains.dokka.it.ProcessResult import java.io.File -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertTrue +import kotlin.test.* class MavenIntegrationTest : AbstractIntegrationTest() { @@ -69,6 +66,8 @@ class MavenIntegrationTest : AbstractIntegrationTest() { } assertEquals("""/* custom stylesheet */""", stylesDir.resolve("custom-style-to-add.css").readText()) assertTrue(imagesDir.resolve("custom-resource.svg").isFile) + + assertConfiguredVisibility(projectDir) } @Test @@ -146,4 +145,26 @@ class MavenIntegrationTest : AbstractIntegrationTest() { "Expected at least one report of undocumented java code (found $amountOfUndocumentedJavaReports)" ) } + + private fun assertConfiguredVisibility(projectDir: File) { + val projectHtmlFiles = projectDir.allHtmlFiles().toList() + + assertContentVisibility( + contentFiles = projectHtmlFiles, + documentPublic = true, + documentProtected = true, // sourceSet documentedVisibilities + documentInternal = false, + documentPrivate = true // for overriddenVisibility package + ) + + assertContainsFilePaths( + outputFiles = projectHtmlFiles, + expectedFilePaths = listOf( + // documentedVisibilities is overridden for package `overriddenVisibility` specifically + // to include private code, so html pages for it are expected to have been created + Regex("it\\.overriddenVisibility/-visible-private-class/private-method\\.html"), + Regex("it\\.overriddenVisibility/-visible-private-class/private-val\\.html"), + ) + ) + } } |