/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġorg . jetbrains . android . facet Ċ Ċ import Ġcom . android . tools . idea . project system . source Providers Ċ import Ġcom . android . tools . idea . testing . Android Gradle Project Rule Ċ import Ġcom . android . tools . idea . testing . Android Project Rule Ċ import Ġcom . android . tools . idea . testing . Test Project Paths Ċ import Ġcom . android . tools . idea . testing . find App Module Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . intellij . Project Topics Ċ import Ġcom . intellij . facet . Facet Manager Ċ import Ġcom . intellij . openapi . application . invoke And Wait IfNeeded Ċ import Ġcom . intellij . openapi . roots . impl . Module Root Event Impl Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ Ċ class ĠSource Provider Manager Test Ġ{ ĊĠ Ġ@ get : Rule ĊĠ Ġval Ġproject Rule Ġ= ĠAndroid Project Rule . in Memory () ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġself Dis poses On Facet Configuration Change () Ġ{ ĊĠĠĠ Ġval Ġfacet Ġ= ĠAndroid Facet . getInstance ( project Rule . module ) !! ĊĠĠĠ Ġval Ġsource Provider Manager Before Notification Ġ= Ġfacet . source Providers ĊĠĠĠ Ġinvoke And Wait IfNeeded Ġ{ ĊĠĠĠĠĠ Ġproject Rule . module . message Bus . sync Publisher ( Facet Manager . FAC ETS _ TOPIC ). facet Configuration Changed ( facet ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġsource Provider Manager After Notification Ġ= Ġfacet . source Providers ĊĠĠĠ ĠassertThat ( source Provider Manager After Notification ). isNot Same As ( source Provider Manager Before Notification ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġself Dis poses On Project Roots Change () Ġ{ ĊĠĠĠ Ġval Ġfacet Ġ= ĠAndroid Facet . getInstance ( project Rule . module ) !! ĊĠĠĠ Ġval Ġsource Provider Manager Before Notification Ġ= Ġfacet . source Providers ĊĠĠĠ Ġinvoke And Wait IfNeeded Ġ{ ĊĠĠĠĠĠ Ġval Ġpublisher Ġ= Ġproject Rule . project . message Bus . sync Publisher ( Project Topics . PROJECT _ ROOT S ) ĊĠĠĠĠĠ Ġpublisher . before Roots Change ( Module Root Event Impl ( project Rule . project , Ġfalse )) ĊĠĠĠĠĠ Ġpublisher . roots Changed ( Module Root Event Impl ( project Rule . project , Ġfalse )) ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġsource Provider Manager After Notification Ġ= Ġfacet . source Providers ĊĠĠĠ ĠassertThat ( source Provider Manager After Notification ). isNot Same As ( source Provider Manager Before Notification ) ĊĠ Ġ} Ċ } Ċ Ċ class ĠGradle Source Provider Manager Test Ġ{ ĊĠ Ġ@ get : Rule ĊĠ Ġval Ġproject Rule Ġ= ĠAndroid Gradle Project Rule () ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġself Dis poses On Facet Configuration Change () Ġ{ ĊĠĠĠ Ġproject Rule . load ( Test Project Paths . SIMPLE _ APPLICATION ) ĊĠĠĠ Ġval Ġfacet Ġ= ĠAndroid Facet . getInstance ( project Rule . project . find App Module () Ġ) !! ĊĠĠĠ Ġval Ġsource Provider Manager Before Notification Ġ= Ġfacet . source Providers ĊĠĠĠ Ġproject Rule . request Sync And Wait () ĊĠĠĠ Ġval Ġsource Provider Manager After Notification Ġ= Ġfacet . source Providers ĊĠĠĠ ĠassertThat ( source Provider Manager After Notification ). isNot Same As ( source Provider Manager Before Notification ) ĊĠ Ġ} Ċ }