From cb20227d354b1b74ca6784d55ea75cc8b5281abd Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 7 Jul 2020 11:08:34 +0200 Subject: Implement simple cli integration test --- .../it/gradle/AbstractGradleIntegrationTest.kt | 37 ++-------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'integration-tests/gradle/src/main') diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt index bb2d0cc6..c8c8c844 100644 --- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt @@ -2,25 +2,17 @@ package org.jetbrains.dokka.it.gradle import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.internal.DefaultGradleRunner -import org.junit.Rule -import org.junit.rules.TemporaryFolder +import org.jetbrains.dokka.it.AbstractIntegrationTest import org.junit.runner.RunWith import org.junit.runners.Parameterized import java.io.File import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertFalse @RunWith(Parameterized::class) -abstract class AbstractGradleIntegrationTest { +abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() { abstract val versions: BuildVersions - @get:Rule - val temporaryTestFolder = TemporaryFolder() - - val projectDir get() = File(temporaryTestFolder.root, "project") - @BeforeTest fun copyTemplates() { File("projects").listFiles().orEmpty() @@ -49,30 +41,5 @@ abstract class AbstractGradleIntegrationTest { ).run { this as DefaultGradleRunner } .withJvmArguments("-Xmx4G", "-XX:MaxMetaspaceSize=512M") } - - fun File.allDescendentsWithExtension(extension: String): Sequence { - return this.walkTopDown().filter { it.isFile && it.extension == extension } - } - - fun File.allHtmlFiles(): Sequence { - return allDescendentsWithExtension("html") - } - - protected fun assertContainsNoErrorClass(file: File) { - val fileText = file.readText() - assertFalse( - fileText.contains("ERROR CLASS", ignoreCase = true), - "Unexpected `ERROR CLASS` in ${file.path}\n" + fileText - ) - } - - protected fun assertNoUnresolvedLInks(file: File) { - val regex = Regex("[\"']#[\"']") - val fileText = file.readText() - assertFalse( - fileText.contains(regex), - "Unexpected unresolved link in ${file.path}\n" + fileText - ) - } } -- cgit