diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-11-10 11:46:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 11:46:54 +0100 |
commit | 8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch) | |
tree | 1b915207b2b9f61951ddbf0ff2e687efd053d555 /plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt | |
parent | a44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff) | |
download | dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2 dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip |
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing
* Update Gradle to 8.4
* Refactor and simplify convention plugins and build scripts
Fixes #3132
---------
Co-authored-by: Adam <897017+aSemy@users.noreply.github.com>
Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt deleted file mode 100644 index 1a747429..00000000 --- a/plugins/base/src/test/kotlin/locationProvider/JavadocExternalLocationProviderTest.kt +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. - */ - -package locationProvider - -import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvider -import org.jetbrains.dokka.base.resolvers.external.javadoc.JavadocExternalLocationProvider -import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation -import org.jetbrains.dokka.base.resolvers.shared.PackageList -import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest -import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.links.DRIExtraContainer -import org.jetbrains.dokka.links.EnumEntryDRIExtra -import org.jetbrains.dokka.links.PointingToDeclaration -import org.jetbrains.dokka.plugability.DokkaContext -import java.net.URL -import kotlin.test.Test -import kotlin.test.assertEquals - -class JavadocExternalLocationProviderTest : BaseAbstractTest() { - private val testDataDir = - getTestDataDir("locationProvider").toAbsolutePath().toString().removePrefix("/").let { "/$it" } - - private val jdk = "https://docs.oracle.com/javase/8/docs/api/" - private val jdkPackageListURL = URL("file://$testDataDir/jdk8-package-list") - - private val configuration = dokkaConfiguration { - sourceSets { - sourceSet { - sourceRoots = listOf("src/") - classpath += jvmStdlibPath!! - } - } - } - - private fun getTestLocationProvider(context: DokkaContext? = null): DefaultExternalLocationProvider { - val dokkaContext = context ?: DokkaContext.create(configuration, logger, emptyList()) - val packageList = PackageList.load(jdkPackageListURL, 8, true)!! - val externalDocumentation = - ExternalDocumentation(URL(jdk), packageList) - return JavadocExternalLocationProvider(externalDocumentation, "--", "-", dokkaContext) - } - - @Test - fun `link to enum entity of javadoc`() { - val locationProvider = getTestLocationProvider() - val ktDri = DRI( - "java.nio.file", - "StandardOpenOption.CREATE", - extra = DRIExtraContainer().also { it[EnumEntryDRIExtra] = EnumEntryDRIExtra }.encode() - ) - val javaDri = DRI( - "java.nio.file", - "StandardOpenOption.CREATE", - null, - PointingToDeclaration, - DRIExtraContainer().also { it[EnumEntryDRIExtra] = EnumEntryDRIExtra }.encode() - ) - - assertEquals( - "https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html#CREATE", - locationProvider.resolve(ktDri) - ) - - assertEquals( - "https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html#CREATE", - locationProvider.resolve(javaDri) - ) - } - - @Test - fun `link to nested class of javadoc`() { - val locationProvider = getTestLocationProvider() - val dri = DRI( - "java.rmi.activation", - "ActivationGroupDesc.CommandEnvironment" - ) - - assertEquals( - "https://docs.oracle.com/javase/8/docs/api/java/rmi/activation/ActivationGroupDesc.CommandEnvironment.html", - locationProvider.resolve(dri) - ) - } -} |