Move: Convert AbstractMoveTest to light fixture test case

Extract multi-module move test to a separate class
This commit is contained in:
Alexey Sedunov
2017-03-28 20:50:03 +03:00
parent 691322e406
commit 2eb912a30c
99 changed files with 269 additions and 147 deletions
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="module" module-name="B" />
</component>
</module>
@@ -0,0 +1,5 @@
package packA1
import packA2.InternalContentUser
class More
@@ -0,0 +1,11 @@
package packA2
import packA1.InternalContent
class InternalContentUser {
fun useInternal(p: InternalContent) = p.internalFun()
internal fun internalFun() {
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>
@@ -0,0 +1,13 @@
package packB
class InternalContent {
internal fun internalFun() {}
fun useInternalInside() {
internalFun()
}
fun useInternal() {
InternalContentUser().internalFun()
}
}
@@ -0,0 +1 @@
This file is needed to ensure that containing directory is under version control
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="module" module-name="B" />
</component>
</module>
@@ -0,0 +1,17 @@
package packA1
import packA2.InternalContentUser
class <caret>InternalContent {
internal fun internalFun() {}
fun useInternalInside() {
internalFun()
}
fun useInternal() {
InternalContentUser().internalFun()
}
}
class More
@@ -0,0 +1,11 @@
package packA2
import packA1.InternalContent
class InternalContentUser {
fun useInternal(p: InternalContent) = p.internalFun()
internal fun internalFun() {
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>
@@ -0,0 +1 @@
This file is needed to ensure that containing directory is under version control
@@ -0,0 +1,6 @@
Class InternalContent uses function internalFun() which will be inaccessible after move
Class packA1.InternalContent, referenced in file InternalSource.kt, will not be accessible from module A
Class packA1.InternalContent, referenced in file InternalSource.kt, will not be accessible from module A
Class packA2.InternalContentUser, referenced in function packA1.InternalContent.useInternal(), will not be accessible in module B
Function packA2.InternalContentUser.internalFun(), referenced in function packA1.InternalContent.useInternal(), will not be accessible in module B
Function useInternal(InternalContent) uses internal function internalFun() which will be inaccessible after move
@@ -0,0 +1,7 @@
{
"mainFile": "A/src/packA1/InternalTarget.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "packB",
"targetSourceRoot": "B/src",
"withRuntime": "true"
}