Spring Support: Implement @ComponentScan inspection

#KT-12465 Fixed
This commit is contained in:
Alexey Sedunov
2016-05-23 15:49:45 +03:00
parent d69140b7fe
commit 781a1e0694
9 changed files with 102 additions and 0 deletions
@@ -0,0 +1,6 @@
package foo
// Make PsiPackage not empty
fun dummyFun() {
}
@@ -0,0 +1,18 @@
<problems>
<problem>
<file>test.kt</file>
<line>14</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">@ComponentScan setup (Kotlin)</problem_class>
<description>Cannot resolve package bar</description>
</problem>
<problem>
<file>test.kt</file>
<line>18</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">@ComponentScan setup (Kotlin)</problem_class>
<description>Cannot resolve package bar</description>
</problem>
</problems>
@@ -0,0 +1,3 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.spring.inspections.KotlinSpringComponentScanInspection
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
// CONFIGURE_SPRING_FILE_SET
@@ -0,0 +1,19 @@
// WITH_RUNTIME
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
@Configuration
@ComponentScan(basePackages = arrayOf("foo"))
open class App1
@Configuration
@ComponentScan(basePackages = arrayOf("foo", "bar"))
open class App2
@Configuration
@ComponentScan(basePackages = arrayOf("bar"))
open class App3