package org.gradle.kotlin.dsl.support

import org.gradle.kotlin.dsl.fixtures.AbstractIntegrationTest
import org.hamcrest.CoreMatchers.containsString
import org.junit.Assert.assertThat
import org.junit.Test

class ImplicitImportsTest : AbstractIntegrationTest() {

    @Test
    fun `implicit imports are fully qualified to allow use of the preferred type amongst those with same simple name in different Gradle API packages`() {

        // given:
        withBuildScript("""

            println("*" + Jar::class.qualifiedName + "*")

        """)

        // when:
        val result = build("help")

        // then:
        assertThat(result.output, containsString("*org.gradle.jvm.tasks.Jar*"))
    }
}

package org.gradle.kotlin.dsl.support

import org.gradle.kotlin.dsl.fixtures.AbstractIntegrationTest
import org.hamcrest.CoreMatchers.containsString
import org.junit.Assert.assertThat
import org.junit.Test

class ImplicitImportsTest : AbstractIntegrationTest() {

    @Test
    fun `implicit imports are fully qualified to allow use of the preferred type amongst those with same simple name in different Gradle API packages`() {

        // given:
        withBuildScript("""

            println("*" + Jar::class.qualifiedName + "*")

        """)

        // when:
        val result = build("help")

        // then:
        assertThat(result.output, containsString("*org.gradle.api.tasks.bundling.Jar*"))
    }
}

Fix implicit imports tests after upstream default imports unification
Fix implicit imports tests after upstream default imports unification

See https://github.com/gradle/gradle/pull/3140

gradle/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle-script-kotlin,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle-script-kotlin,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle