Files
openide/plugins/gradle/java/testSources/execution/build/GradleSyncOutputTest.kt
Sergei Vorobyov f57e1797ab IDEA-333401 [Gradle|Reload] new: added tests on Gradle tasks artifacts importing
GitOrigin-RevId: ffe36325b32dbc808e48bfb5635b0fec9845be23
2023-10-17 17:53:47 +00:00

54 lines
1.8 KiB
Kotlin

// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.plugins.gradle.execution.build
import com.intellij.openapi.application.writeAction
import org.gradle.util.GradleVersion
import org.jetbrains.plugins.gradle.testFramework.GradleReloadProjectTestCase
import org.jetbrains.plugins.gradle.testFramework.annotations.AllGradleVersionsSource
import org.jetbrains.plugins.gradle.testFramework.util.createBuildFile
import org.junit.jupiter.params.ParameterizedTest
class GradleSyncOutputTest : GradleReloadProjectTestCase() {
@ParameterizedTest
@AllGradleVersionsSource
fun `test sync with lazy task configuration`(gradleVersion: GradleVersion) {
test(gradleVersion) {
reloadProject()
executionFixture.assertSyncViewTree {
assertNode("finished")
}
writeAction {
projectRoot.createBuildFile(gradleVersion) {
withJavaPlugin()
withPostfix {
call("tasks.register", string("my-jar-task"), code("Jar")) {
call("project.configurations.create", "my-jar-configuration")
}
}
}
}
reloadProject()
executionFixture.assertSyncViewTree {
assertNode("finished")
}
writeAction {
projectRoot.createBuildFile(gradleVersion) {
withJavaPlugin()
withPostfix {
call("tasks.register", string("my-task")) {
call("project.configurations.create", "my-configuration")
}
call("tasks.register", string("my-jar-task"), code("Jar")) {
call("project.configurations.create", "my-jar-configuration")
}
}
}
}
reloadProject()
executionFixture.assertSyncViewTree {
assertNode("finished")
}
}
}
}