/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . Ġand ĠKotlin ĠProgramming ĠLanguage Ġcontributors . Ċ Ġ* ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe Ġlicense / LICENSE . txt Ġfile . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . idea . navigation Ċ Ċ import Ġcom . intellij . ide . util . goto ByName . G oto Symbol Model 2 Ċ import Ġcom . intellij . openapi . module . Std Module Types Ċ import Ġorg . jetbrains . kotlin . idea . stubs . Abstract Multi Module Test Ċ import Ġorg . jetbrains . kotlin . idea . test . Plugin TestCase Base Ċ import Ġorg . jetbrains . kotlin . idea . test . all Kotlin Files Ċ import Ġorg . jetbrains . kotlin . test . JUnit 3 With Ide a Configuration Runner Ċ import Ġorg . jetbrains . kotlin . test . Mock Library Util Ċ import Ġorg . jetbrains . kotlin . test . util . add Dependency Ċ import Ġorg . jetbrains . kotlin . test . util . jar Root Ċ import Ġorg . jetbrains . kotlin . test . util . project Library Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( JUnit 3 With Ide a Configuration Runner :: class ) Ċ class ĠG oto With Multiple Libraries Test Ġ: ĠAbstract Multi Module Test () Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget TestData Path () Ġ= Ġ"${ Plugin TestCase Base . get TestData Path Base () }/ multi Module Reference Resolve / same Jar In Different Libraries /" ĊĊĠĠĠ Ġfun Ġtest One Has Source And One DoesNot () Ġ{ ĊĠĠĠĠĠĠĠ Ġdo Test Same Jar Shared By Libraries With And Without Source Attached ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Source Ġ= Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġno Source Ġ= Ġ 1 ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest One Has Source And Many DoNot () Ġ{ ĊĠĠĠĠĠĠĠ Ġdo Test Same Jar Shared By Libraries With And Without Source Attached ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Source Ġ= Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġno Source Ġ= Ġ 3 ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest Se veral With Source () Ġ{ ĊĠĠĠĠĠĠĠ Ġdo Test Same Jar Shared By Libraries With And Without Source Attached ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Source Ġ= Ġ 2 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġno Source Ġ= Ġ 2 ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġdo Test Same Jar Shared By Libraries With And Without Source Attached ( with Source : ĠInt , Ġno Source : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsrc Path Ġ= ĠtestData Path Ġ+ Ġ" src " ĊĊĠĠĠĠĠĠĠ Ġval Ġshared Jar Ġ= ĠMock Library Util . compile Jvm Library To Jar ( testData Path Ġ+ Ġ" lib Src ", Ġ" shared Jar ", Ġadd Sources Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ Ġval Ġjar Root Ġ= Ġshared Jar . jar Root ĊĊĠĠĠĠĠĠĠ Ġvar Ġi Ġ= Ġ 0 ĊĠĠĠĠĠĠĠ Ġrepeat ( no Source ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodule (" m ${ ++ i }", Ġsrc Path ). add Dependency ( project Library (" lib A ", Ġjar Root )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrepeat ( with Source ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodule (" m ${ ++ i }", Ġsrc Path ). add Dependency ( project Library (" lib B ", Ġjar Root , Ġjar Root . find Child (" src ") !! )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġcheck Files ({ Ġproject . all Kotlin Files () Ġ}) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠG oto Check . check G oto Directives ( G oto Symbol Model 2 ( project ), Ġeditor , Ġnon Project Symbols Ġ= Ġtrue , Ġcheck Navigation Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmodule ( name : ĠString , Ġsrc Path : ĠString ) Ġ= Ġcreate Module From TestData ( src Path , Ġname , ĠStd Module Types . JAVA , Ġtrue ) Ċ } Ċ