package Ġio . github . sim ons ch iller . pref iller Ċ Ċ import Ġio . github . sim ons ch iller . pref iller . testutil .* Ċ import Ġio . github . sim ons ch iller . pref iller . testutil . spec . Dynamic Feature Project Spec Ċ import Ġio . github . sim ons ch iller . pref iller . testutil . spec . Non Android Project Spec Ċ import Ġio . github . sim ons ch iller . pref iller . testutil . spec . Project Spec Ċ import Ġorg . gradle . test kit . runner . Task Outcome Ċ import Ġorg . junit . jupiter . api . Assertions .* Ċ import Ġorg . junit . jupiter . api . extension . Register Extension Ċ import Ġorg . junit . jupiter . params . Parameterized Test Ċ import Ġorg . junit . jupiter . params . provider . Arguments Source Ċ Ċ class ĠPref iller IntegrationTest Ġ{ ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġ@ Register Extension ĊĠĠĠ Ġval Ġproject Ġ= ĠProject Extension () ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Build Ġfails Ġif Ġplugin Ġis Ġapplied Ġto Ġnon - Android Ġprojects `( gradle Version : ĠString , Ġag p Version : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , ĠNon Android Project Spec ()) ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġproject . run (" clean ", Ġexpect Failure Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( result . output . contains (" Pref iller Ġis Ġonly Ġapplicable Ġto ĠAndroid Ġprojects ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Build Ġfails Ġif Ġschema Ġdirectory Ġis Ġnot Ġfound `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĊĠĠĠĠĠĠĠ Ġvar Ġcontent Ġ= Ġproject . module Build Gradle . read Text () ĊĠĠĠĠĠĠĠ Ġcontent Ġ= Ġcontent . replace (" com . test . People Database ", Ġ" com . test . Invalid Database ") ĊĠĠĠĠĠĠĠ Ġproject . module Build Gradle . write Text ( content ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ", Ġexpect Failure Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( result . output . contains ("' schema Directory ' ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Build Ġfails Ġif ĠSQL Ġfile Ġis Ġinvalid `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĠĠĠĠĠĠĠ Ġproject . script File . append Text (" Normal Ġtext Ġis Ġnot Ġa Ġvalid ĠSQL Ġstatement ") ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ", Ġexpect Failure Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( result . output . contains (" Could Ġnot Ġparse Ġscript ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( No Schema Location Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Build Ġfails Ġif Ġschema Ġlocation Ġis Ġnot Ġconfigured `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ", Ġexpect Failure Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( result . output . contains (" Could Ġnot Ġfind Ġschema Ġlocation ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Pre - filled Ġdatabase Ġfile Ġis Ġgenerated `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĠĠĠĠĠĠĠ Ġproject . run (" pref ill People Debug Database ") ĊĊĠĠĠĠĠĠĠ Ġval Ġdatabase File Ġ= Ġproject . module Dir . resolve (" build / generated / pref iller / debug / people . db ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( database File . exists ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Database Ġis Ġgenerated Ġduring Ġnormal Ġbuild Ġprocess `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĠĠĠĠĠĠĠ Ġproject . run (" assemble Debug ") ĊĊĠĠĠĠĠĠĠ Ġval Ġdatabase File Ġ= Ġproject . module Dir . resolve (" build / generated / pref iller / debug / people . db ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( database File . exists ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Generated Ġdatabase Ġis Ġregistered Ġcorrectly Ġas ĠAndroid Ġasset `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĠĠĠĠĠĠĠ Ġproject . run (" merge Debug Assets ") ĊĊĠĠĠĠĠĠĠ Ġval Ġmerged Assets Dir Ġ= Ġproject . module Dir . resolve (" build / inter medi ates / merged _ assets ") ĊĠĠĠĠĠĠĠ Ġval Ġdatabase File Ġ= Ġmerged Assets Dir . resolve (" debug / out / people . db ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( database File . exists ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Language Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Up - to - date Ġchecks Ġwork Ġcorrectly `( gradle Version : ĠString , Ġag p Version : ĠString , Ġproject Spec : ĠProject Spec ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , Ġproject Spec ) ĊĊĠĠĠĠĠĠĠ Ġvar Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( Task Outcome . SUCCESS , Ġresult . tasks . outcome Of (" pref ill People Debug Database ")) ĊĊĠĠĠĠĠĠĠ Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( Task Outcome . UP _ TO _ DATE , Ġresult . tasks . outcome Of (" pref ill People Debug Database ")) ĊĊĠĠĠĠĠĠĠ Ġ// ĠTrigger Ġchange ĊĠĠĠĠĠĠĠ Ġproject . script File . append Text (""" ĊĠĠĠĠĠĠĠĠĠĠĠ ĠINSERT ĠINTO Ġpeople ( name , Ġage ) ĠVALUES Ġ(" J or ja ĠM add ox ", Ġ 3 9 ); ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent ()) ĊĊĠĠĠĠĠĠĠ Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( Task Outcome . SUCCESS , Ġresult . tasks . outcome Of (" pref ill People Debug Database ")) ĊĊĠĠĠĠĠĠĠ Ġresult Ġ= Ġproject . run (" pref ill People Debug Database ") ĊĠĠĠĠĠĠĠ ĠassertEquals ( Task Outcome . UP _ TO _ DATE , Ġresult . tasks . outcome Of (" pref ill People Debug Database ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Arguments Source ( Test Versions :: class ) ĊĠĠĠ Ġfun Ġ` Dynamic Ġfeature Ġmodules Ġwork Ġcorrectly `( gradle Version : ĠString , Ġag p Version : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . setup ( gradle Version , Ġag p Version , ĠDynamic Feature Project Spec ()) ĊĠĠĠĠĠĠĠ Ġproject . run (": module : pref ill People Debug Database ") ĊĊĠĠĠĠĠĠĠ Ġval Ġdatabase File Ġ= Ġproject . module Dir . resolve (" build / generated / pref iller / debug / people . db ") ĊĠĠĠĠĠĠĠ ĠassertTrue ( database File . exists ()) ĊĠĠĠ Ġ} Ċ } Ċ