Add test on cyclicly dependent Java 9 modules
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
module main {
|
||||
requires moduleA;
|
||||
requires moduleB;
|
||||
requires moduleC;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import a.*
|
||||
import b.*
|
||||
import c.*
|
||||
|
||||
fun usage(): String {
|
||||
val a = A()
|
||||
val b = B()
|
||||
val c = C()
|
||||
return "$a$b$c"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package a;
|
||||
|
||||
public class A {}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module moduleA {
|
||||
exports a;
|
||||
requires transitive moduleC;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package b;
|
||||
|
||||
public class B {}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module moduleB {
|
||||
exports b;
|
||||
requires transitive moduleA;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package c;
|
||||
|
||||
public class C {}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module moduleC {
|
||||
exports c;
|
||||
requires transitive moduleB;
|
||||
}
|
||||
+8
@@ -83,4 +83,12 @@ class Java9MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
|
||||
module("main").addDependency(module("dependency"))
|
||||
checkHighlightingInAllFiles()
|
||||
}
|
||||
|
||||
fun testCyclicDependency() = doTest {
|
||||
val a = module("moduleA")
|
||||
val b = module("moduleB")
|
||||
val c = module("moduleC")
|
||||
module("main").addDependency(a).addDependency(b).addDependency(c)
|
||||
checkHighlightingInAllFiles()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase() {
|
||||
other: Module,
|
||||
dependencyScope: DependencyScope = DependencyScope.COMPILE,
|
||||
exported: Boolean = false
|
||||
) = ModuleRootModificationUtil.addDependency(this, other, dependencyScope, exported)
|
||||
): Module = this.apply { ModuleRootModificationUtil.addDependency(this, other, dependencyScope, exported) }
|
||||
|
||||
protected fun Module.addLibrary(jar: File, name: String = KotlinJdkAndLibraryProjectDescriptor.LIBRARY_NAME) {
|
||||
ConfigLibraryUtil.addLibrary(NewLibraryEditor().apply {
|
||||
|
||||
Reference in New Issue
Block a user