package Ġcom . jetbrains . fort ea . run Ċ Ċ import Ġcom . intellij . execution . Execution Manager Ċ import Ġcom . intellij . execution . impl . Execution Manager Kt Impl Ċ import Ġcom . intellij . openapi . components . Service Manager Ċ import Ġcom . jetbrains . fort ea . configuration . execution . impl . T 4 S ynchronous Run Configuration Executor Ċ import Ġcom . jetbrains . rd client . util . idea . to Virtual File Ċ import Ġcom . jetbrains . r ider . idea Interop . vfs . V fs Write Operations Host Ċ import Ġcom . jetbrains . r ider . model . T 4 Execution Request Ċ import Ġcom . jetbrains . r ider . model . T 4 File Location Ċ import Ġcom . jetbrains . r ider . model . t 4 Protocol Model Ċ import Ġcom . jetbrains . r ider . project View . Project Model View Host Ċ import Ġcom . jetbrains . r ider . project View . solution Ċ import Ġcom . jetbrains . r ider . project View . solution Directory Ċ import Ġcom . jetbrains . r ider . test . assert s . should Not BeNull Ċ import Ġcom . jetbrains . r ider . test . base . Base Test With Solution Ċ import Ġcom . jetbrains . r ider . test . framework . combine Ċ import Ġcom . jetbrains . r ider . test . framework . execute With Gold Ċ import Ġcom . jetbrains . r ider . test . framework . flush Queues Ċ import Ġcom . jetbrains . r ider . test . script ing Api . wait All Commands Finished Ċ import Ġcom . jetbrains . r ider . test . script ing Api . waitFor Project Model Ready Ċ import Ġcom . jetbrains . r ider . util . idea . application Ċ import Ġcom . jetbrains . r ider . util . idea . getComponent Ċ import Ġorg . testng . annotations . Before Method Ċ import Ġjava . io . File Ċ Ċ open Ġclass ĠT 4 Run File TestBase Ġ: ĠBaseTest With Solution () Ġ{ ĊĠ Ġoverride Ġval ĠwaitFor Caches Ġ= Ġtrue ĊĠ Ġoverride Ġfun Ġget Solution DirectoryName () Ġ= Ġtest Method . name ĊĊĠ Ġprotected Ġval Ġt 4 File ĊĠĠĠ Ġget () Ġ= Ġproject ĊĠĠĠĠĠ Ġ. solution Directory ĊĠĠĠĠĠ Ġ. combine (" Project ") ĊĠĠĠĠĠ Ġ. list Files Ġ{ Ġ_, Ġname Ġ-> Ġname . endsWith (". tt ") Ġor Ġname . endsWith (". t 4 ") Ġ} ĊĠĠĠĠĠ Ġ. should Not BeNull () ĊĠĠĠĠĠ Ġ. single () ĊĊĠ Ġprivate Ġval Ġc sproj File ĊĠĠĠ Ġget () Ġ= Ġt 4 File ĊĠĠĠĠĠ Ġ. parent File ĊĠĠĠĠĠ Ġ. list Files Ġ{ Ġ_, Ġname Ġ-> Ġname . endsWith (". csproj ") Ġ} ĊĠĠĠĠĠ Ġ. should Not BeNull () ĊĠĠĠĠĠ Ġ. single () ĊĊĠ Ġprivate Ġval ĠoutputFile Candidates ĊĠĠĠ Ġget () Ġ= Ġt 4 File . parent File . list Files (). should Not BeNull () ĊĊĠ Ġprivate Ġfun Ġfind OutputFile ( result Extension : ĠString ?): ĠFile Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( result Extension Ġ== Ġnull ) ĠoutputFile Candidates . single Ġ{ ĊĠĠĠĠĠ Ġit . name Without Extension Ġ== Ġt 4 File . name Without Extension ĊĠĠĠĠĠĠĠ Ġ&& Ġit . name Ġ!= Ġt 4 File . name ĊĠĠĠĠĠĠĠ Ġ&& Ġ! it . name . endsWith (". tmp ") ĊĠĠĠĠĠĠĠ Ġ&& Ġ! it . name . endsWith (". gold ") ĊĠĠĠ Ġ} Ġelse ĠoutputFile Candidates . single Ġ{ ĊĠĠĠĠĠ Ġit . name Ġ== Ġt 4 File . name Without Extension Ġ+ Ġresult Extension ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Before Method ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ Ġval Ġmanager Ġ= ĠService Manager . getService ( project , ĠExecution Manager :: class . java ) Ġas ĠExecution Manager Kt Impl ĊĠĠĠ Ġmanager . force Compilation In Tests Ġ= Ġtrue ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġdo Test ( result Extension : ĠString ? Ġ= Ġnull , Ġdump C sproj : ĠBoolean Ġ= Ġtrue ) Ġ{ ĊĠĠĠ Ġexecute T 4 File () ĊĠĠĠ Ġsave Solution () ĊĠĠĠ Ġdump Execution Result ( result Extension ) ĊĠĠĠ Ġif Ġ( dump C sproj ) Ġdump C sproj () ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġexecute T 4 File () Ġ{ ĊĠĠĠ Ġval Ġhost Ġ= Ġproject . getComponent < Project Model View Host >() ĊĠĠĠ Ġval Ġvirtual File Ġ= Ġt 4 File . path . to Virtual File ( true ). should Not BeNull () ĊĠĠĠ Ġval Ġid Ġ= Ġhost . getItems By Virtual File ( virtual File ). single (). id ĊĠĠĠ Ġval Ġlocation Ġ= ĠT 4 File Location ( id ) ĊĠĠĠ Ġproject . solution . t 4 Protocol Model . prepare Execution . sync ( location ) ĊĠĠĠ Ġval Ġrequest Ġ= ĠT 4 Execution Request ( location , Ġfalse ) ĊĠĠĠ ĠT 4 S ynchronous Run Configuration Executor ( project , Ġhost ) Ġ{ ĊĠĠĠĠĠ Ġ! T 4 S ynchronous Run Configuration Executor . is Execution Running ĊĠĠĠ Ġ}. execute ( request ) ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġsave Solution () Ġ{ ĊĠĠĠ Ġapplication . save All () ĊĠĠĠ Ġflush Queues () ĊĠĠĠ ĠwaitFor Project Model Ready ( project ) ĊĠĠĠ Ġwait All Commands Finished () ĊĠĠĠ Ġproject . getComponent < V fs Write Operations Host >(). wait Refresh Is Finished () ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġdump C sproj () Ġ= Ġexecute With Gold ( csproj File . path ) Ġ{ ĊĠĠĠ Ġit . print ( csproj File . read Text ()) ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġdump Execution Result ( result Extension : ĠString ? Ġ= Ġnull ) Ġ= Ġexecute With Gold ( t 4 File . path ) Ġ{ ĊĠĠĠ Ġit . print ( find OutputFile ( result Extension ). read Text ()) ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġassert No Output With Extension ( extension : ĠString ) Ġ= Ġassert ( outputFile Candidates . none Ġ{ ĊĠĠĠ Ġit . name Without Extension Ġ== Ġt 4 File . name Without Extension Ġ&& Ġit . name . endsWith ( extension ) ĊĠ Ġ}) Ċ } Ċ