diff options
author | Paul Merlin <paul@gradle.com> | 2018-09-15 16:34:04 +0200 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2019-01-25 17:29:02 +0300 |
commit | a32ce3282935b382f285f66c65484409d96328c7 (patch) | |
tree | 72fd698816e2b6166d87b618c8041d9d56e3f482 | |
parent | 43ab42296520e8fba8d115ab1f6e3a9388f818d3 (diff) | |
download | dokka-a32ce3282935b382f285f66c65484409d96328c7.tar.gz dokka-a32ce3282935b382f285f66c65484409d96328c7.tar.bz2 dokka-a32ce3282935b382f285f66c65484409d96328c7.zip |
Refine type safe configuration test
Signed-off-by: Paul Merlin <paul@gradle.com>
2 files changed, 64 insertions, 66 deletions
diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt index ab8bc62b..7b179e92 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt @@ -1,10 +1,8 @@ package org.jetbrains.dokka.gradle -import org.gradle.testkit.runner.TaskOutcome import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized -import kotlin.test.assertEquals @RunWith(Parameterized::class) class TypeSafeConfigurationTest(private val testCase: TestCase) : AbstractDokkaGradleTest() { @@ -25,14 +23,14 @@ class TypeSafeConfigurationTest(private val testCase: TestCase) : AbstractDokkaG @Test fun test() { - testDataFolder.resolve("typeSafeConfiguration").toFile().copyRecursively(testProjectDir.root) + + testDataFolder.resolve("typeSafeConfiguration").toFile() + .copyRecursively(testProjectDir.root) + configure( testCase.gradleVersion, testCase.kotlinVersion, arguments = arrayOf("help", "-s") - ).build().apply { - println(output) - assertEquals(TaskOutcome.SUCCESS, task(":help")?.outcome) - } + ).build() } -}
\ No newline at end of file +} diff --git a/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle b/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle index 923c07d8..327cead8 100644 --- a/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle +++ b/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle @@ -21,64 +21,64 @@ plugins { apply plugin: 'kotlin' @CompileStatic -def configureDokkaTypeSafely(Project project) { - project.tasks.withType(DokkaTask) { DokkaTask dokka -> - dokka.with { - moduleName = "some String" - outputFormat = "some String" - outputDirectory = "some String" - classpath = Collections.singleton(file("someClassDir")) - includes = Collections.emptyList() - linkMappings = new ArrayList<LinkMapping>() - samples = Collections.emptyList() - jdkVersion = 6 - sourceDirs = Collections.<File>emptyList() - sourceRoots = new ArrayList<SourceRoot>() - dokkaFatJar = file("some File") - includeNonPublic = false - skipDeprecated = false - skipEmptyPackages = true - reportUndocumented = true - perPackageOptions = new ArrayList<PackageOptions>() - impliedPlatforms = Collections.<String>emptyList() - externalDocumentationLinks = new ArrayList<DokkaConfiguration.ExternalDocumentationLink>() - noStdlibLink = false - cacheRoot = null as String - languageVersion = null as String - apiVersion = null as String - kotlinTasks(new Callable<List<Object>>() { - @Override - List<Object> call() { - return defaultKotlinTasks() - } - }) - linkMapping(new Action<LinkMapping>() { - @Override - void execute(LinkMapping mapping) { - mapping.dir = "some String" - mapping.url = "some String" - } - }) - sourceRoot(new Action<SourceRoot>() { - @Override - void execute(SourceRoot sourceRoot) { - sourceRoot.path = "some String" - } - }) - packageOptions(new Action<PackageOptions>() { - @Override - void execute(PackageOptions packageOptions) { - packageOptions.prefix = "some String" - } - }) - externalDocumentationLink(new Action<DokkaConfiguration.ExternalDocumentationLink.Builder>() { - @Override - void execute(DokkaConfiguration.ExternalDocumentationLink.Builder builder) { - builder.url = uri("some URI").toURL() - } - }) - } +def configureDokkaTypeSafely(DokkaTask dokka) { + dokka.with { + moduleName = "some String" + outputFormat = "some String" + outputDirectory = "some String" + classpath = Collections.singleton(file("someClassDir")) + includes = Collections.emptyList() + linkMappings = new ArrayList<LinkMapping>() + samples = Collections.emptyList() + jdkVersion = 6 + sourceDirs = Collections.<File>emptyList() + sourceRoots = new ArrayList<SourceRoot>() + dokkaFatJar = file("some File") + includeNonPublic = false + skipDeprecated = false + skipEmptyPackages = true + reportUndocumented = true + perPackageOptions = new ArrayList<PackageOptions>() + impliedPlatforms = Collections.<String>emptyList() + externalDocumentationLinks = new ArrayList<DokkaConfiguration.ExternalDocumentationLink>() + noStdlibLink = false + cacheRoot = null as String + languageVersion = null as String + apiVersion = null as String + kotlinTasks(new Callable<List<Object>>() { + @Override + List<Object> call() { + return defaultKotlinTasks() + } + }) + linkMapping(new Action<LinkMapping>() { + @Override + void execute(LinkMapping mapping) { + mapping.dir = "some String" + mapping.url = "some String" + } + }) + sourceRoot(new Action<SourceRoot>() { + @Override + void execute(SourceRoot sourceRoot) { + sourceRoot.path = "some String" + } + }) + packageOptions(new Action<PackageOptions>() { + @Override + void execute(PackageOptions packageOptions) { + packageOptions.prefix = "some String" + } + }) + externalDocumentationLink(new Action<DokkaConfiguration.ExternalDocumentationLink.Builder>() { + @Override + void execute(DokkaConfiguration.ExternalDocumentationLink.Builder builder) { + builder.url = uri("some URI").toURL() + } + }) } } -configureDokkaTypeSafely(project) +project.tasks.withType(DokkaTask) { dokka -> + configureDokkaTypeSafely(dokka) +} |