From 9ab87cf839d712e4ca5cdc3f15c44ffc353411a0 Mon Sep 17 00:00:00 2001 From: Till Krullmann Date: Sun, 29 Sep 2019 22:19:56 +0200 Subject: [PATCH] Delete old Groovy integration tests (they were ported to Kotlin) --- ...EnvironmentVariableAvailabilityTest.groovy | 76 ------------------- .../SystemPropertyAvailabilityTest.groovy | 75 ------------------ src/test/kotlin/EnvironmentTest.java | 11 --- 3 files changed, 162 deletions(-) delete mode 100644 src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/EnvironmentVariableAvailabilityTest.groovy delete mode 100644 src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/SystemPropertyAvailabilityTest.groovy delete mode 100644 src/test/kotlin/EnvironmentTest.java diff --git a/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/EnvironmentVariableAvailabilityTest.groovy b/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/EnvironmentVariableAvailabilityTest.groovy deleted file mode 100644 index e5e040a..0000000 --- a/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/EnvironmentVariableAvailabilityTest.groovy +++ /dev/null @@ -1,76 +0,0 @@ -package org.unbrokendome.gradle.plugins.testsets - -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Rule -import org.junit.rules.TemporaryFolder -import spock.lang.Specification - -import java.nio.file.Files - -class EnvironmentVariableAvailabilityTest extends Specification { - - @Rule - TemporaryFolder projectDir - - File buildFile - - def setup() { - buildFile = projectDir.newFile('build.gradle') - - buildFile << ''' - plugins { - id 'groovy' - id "org.unbroken-dome.test-sets" - } - - repositories { - jcenter() - } - - dependencies { - testCompile "junit:junit:4.12" - testCompile "org.codehaus.groovy:groovy-all:2.4.13" - testCompile "org.spockframework:spock-core:1.1-groovy-2.4" - } - - testSets { - integrationTest { - environmentVariables = ["TESTVAR" : "TESTVALUE"] - } - } - ''' - def testSourceDir = projectDir.root.toPath().resolve('src/integrationTest/groovy') - Files.createDirectories(testSourceDir) - def testFilePath = testSourceDir.resolve("TestSpec.groovy") - def testFile = Files.createFile(testFilePath).toFile() - - testFile << ''' - import spock.lang.Specification - - class TestSpec extends Specification { - - def "Environment variable is available."() { - expect: - System.getenv("TESTVAR") == "TESTVALUE" - } - } - ''' - } - - def "Environment variable is available in test."() { - when: - def result = GradleRunner.create() - .withProjectDir(projectDir.root) - .withPluginClasspath() - .withArguments('integrationTest', '--stacktrace') - .withDebug(true) - .forwardOutput() - .build() - - then: - - result.task(':integrationTest').outcome == TaskOutcome.SUCCESS - } - -} diff --git a/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/SystemPropertyAvailabilityTest.groovy b/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/SystemPropertyAvailabilityTest.groovy deleted file mode 100644 index 4cac5bf..0000000 --- a/src/integrationTest/groovy/org/unbrokendome/gradle/plugins/testsets/SystemPropertyAvailabilityTest.groovy +++ /dev/null @@ -1,75 +0,0 @@ -package org.unbrokendome.gradle.plugins.testsets - -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Rule -import org.junit.rules.TemporaryFolder -import spock.lang.Specification - -import java.nio.file.Files - -class SystemPropertyAvailabilityTest extends Specification { - - @Rule - TemporaryFolder projectDir - - File buildFile - - def setup() { - buildFile = projectDir.newFile('build.gradle') - - buildFile << ''' - plugins { - id 'groovy' - id "org.unbroken-dome.test-sets" - } - - repositories { - jcenter() - } - - dependencies { - testCompile "junit:junit:4.12" - testCompile "org.codehaus.groovy:groovy-all:2.4.13" - testCompile "org.spockframework:spock-core:1.1-groovy-2.4" - } - - testSets { - integrationTest { - systemProperties = ["TESTVAR" : "TESTVALUE"] - } - } - ''' - def testSourceDir = projectDir.root.toPath().resolve('src/integrationTest/groovy') - Files.createDirectories(testSourceDir) - def testFilePath = testSourceDir.resolve("TestSpec.groovy") - def testFile = Files.createFile(testFilePath).toFile() - - testFile << ''' - import spock.lang.Specification - - class TestSpec extends Specification { - - def "Environment variable is available."() { - expect: - System.getProperty("TESTVAR") == "TESTVALUE" - } - } - ''' - } - - def "Environment variable is available in test."() { - when: - def result = GradleRunner.create() - .withProjectDir(projectDir.root) - .withPluginClasspath() - .withArguments('integrationTest', '--stacktrace') - .withDebug(true) - .forwardOutput() - .build() - - then: - result.task(':integrationTest').outcome == TaskOutcome.SUCCESS - } - -} diff --git a/src/test/kotlin/EnvironmentTest.java b/src/test/kotlin/EnvironmentTest.java deleted file mode 100644 index 185e669..0000000 --- a/src/test/kotlin/EnvironmentTest.java +++ /dev/null @@ -1,11 +0,0 @@ -import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.Test; - -class EnvironmentTest { - - @Test - void shouldHaveEnvironmentAvailable() { - String value = System.getenv("TESTVAR"); - assertEquals("TESTVALUE", value); - } -}