package Ġcom . el pass ion . main fr amer plugin . integration Ċ Ċ import Ġcom . el pass ion . main fr amer plugin . action . select . Task Manip ulator Ċ import Ġcom . el pass ion . main fr amer plugin . action . select . Template Configurations Provider Ċ import Ġcom . el pass ion . main fr amer plugin . task . Main fr amer Task Ċ import Ġcom . el pass ion . main fr amer plugin . task . Main fr amer Task Provider Ċ import Ġcom . el pass ion . main fr amer plugin . task . Main fr amer Task Default Settings Provider Ċ import Ġcom . el pass ion . main fr amer plugin . task . Task Data Ċ import Ġcom . intellij . execution . Executor Ċ import Ġcom . intellij . execution . Run Manager Ex Ċ import Ġcom . intellij . execution . configurations . Configuration Factory Ċ import Ġcom . intellij . execution . configurations . Configuration Type Ċ import Ġcom . intellij . execution . configurations . Run Configuration Ċ import Ġcom . intellij . execution . configurations . Run Configuration Base Ċ import Ġcom . intellij . execution . configurations . Run Configuration Options Ċ import Ġcom . intellij . execution . runners . Execution Environment Ċ import Ġcom . intellij . icons . All Icons Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . test Framework . fixtures . Light Platform Code Insight Fixture TestCase Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Assert . assertNot Equals Ċ import Ġjava . util .* Ċ import Ġjavax . swing . Icon Ċ Ċ class ĠInject ing Main fr amer Task TestCase Ġ: ĠLight Platform Code Insight Fixture TestCase () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġtask Injector Ġby Ġlazy Ġ{ ĠTask Manip ulator ( project ) Ġ} ĊĠĠĠ Ġprivate Ġval Ġrun Manager Ġby Ġlazy Ġ{ ĠRun Manager Ex . getInstance Ex ( project ) Ġ} ĊĊĠĠĠ Ġfun Ġtest Should Add Main fr amer To Configuration () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġadd Test Configuration ( create Test Configuration Type ()) ĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĊĠĠĠĠĠĠĠ Ġverify Before Run Tasks ( run Configuration ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Size ( 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. all Match Ġ{ Ġit Ġis ĠMain fr amer Task Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest Should Remove Main fr amer From Configuration () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġadd Test Configuration ( create Test Configuration Type ()) ĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĠĠĠĠĠĠĠ Ġrestore Configurations ( run Configuration ) ĊĊĠĠĠĠĠĠĠ Ġverify Before Run Tasks ( run Configuration ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. isEmpty () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest Should Add Main fr amer To Template Configuration () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġadd Test Template Configuration () ĊĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĊĠĠĠĠĠĠĠ Ġverify Before Run Tasks ( run Configuration ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Size ( 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. all Match Ġ{ Ġit Ġis ĠMain fr amer Task Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest Should Remove Main fr amer From Template Configuration () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġadd Test Template Configuration () ĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĠĠĠĠĠĠĠ Ġrestore Configurations ( run Configuration ) ĊĊĠĠĠĠĠĠĠ Ġverify Before Run Tasks ( run Configuration ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. isEmpty () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtest Should Replace Main fr amer Make Data When Task Exist ed Before Injection () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġadd Test Template Configuration () ĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĠĠĠĠĠĠĠ Ġval Ġold Task Data Ġ= Ġfirst Task Data ( run Configuration ) ĊĠĠĠĠĠĠĠ ĠMain fr amer Task Default Settings Provider . getInstance ( project ). task Data Ġ= ĠTask Data ( main fr amer Path Ġ= Ġ" path 2 ") ĊĠĠĠĠĠĠĠ Ġinject Main fr amer ( run Configuration ) ĊĠĠĠĠĠĠĠ Ġval Ġnew Task Data Ġ= Ġfirst Task Data ( run Configuration ) ĊĊĠĠĠĠĠĠĠ Ġassert Not Equals ( old Task Data , Ġnew Task Data ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġfirst Task Data ( run Configuration : ĠRun Configuration ) Ġ= Ġ( run Manager . get Before Run Tasks ( run Configuration ). first () Ġas ĠMain fr amer Task ). data ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Test Configuration Type () Ġ= ĠTest Configuration Type ( random String ()) ĊĊĠĠĠ Ġprivate Ġfun Ġadd Test Configuration ( test Configuration Type : ĠTest Configuration Type ): ĠRun Configuration Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtest Configuration Factory Ġ= Ġtest Configuration Type . configuration Factories . first () ĊĠĠĠĠĠĠĠ Ġval Ġrun Configuration Ġ= Ġrun Manager . create Configuration ( random String (), Ġtest Configuration Factory ) ĊĠĠĠĠĠĠĠ Ġrun Manager . add Configuration ( run Configuration , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn Ġrun Configuration . configuration ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġadd Test Template Configuration (): ĠRun Configuration Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtest Configuration Type Ġ= Ġcreate Test Configuration Type () ĊĠĠĠĠĠĠĠ ĠTemplate Configurations Provider . test Value Ġ= ĠlistOf ( test Configuration Type ) ĊĠĠĠĠĠĠĠ Ġval Ġconfiguration Factory Ġ= Ġtest Configuration Type . configuration Factories . first () ĊĠĠĠĠĠĠĠ Ġreturn Ġrun Manager . getConfiguration Template ( configuration Factory ). configuration ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġclass ĠTest Configuration Factory ( test Configuration Type : ĠTest Configuration Type , Ġval Ġuuid : ĠString ) Ġ: ĠConfiguration Factory ( test Configuration Type ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġcreate Template Configuration ( project : ĠProject ): ĠRun Configuration Ġ= ĠTest Run Configuration Base ( this , Ġproject , Ġuuid ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġclass ĠTest Run Configuration Base ( configuration Factory : ĠConfiguration Factory , Ġproject : ĠProject , Ġuuid : ĠString ) Ġ: ĠRun Configuration Base < Run Configuration Options >( project , Ġconfiguration Factory , Ġuuid ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġcheck Configuration () Ġ= ĠUnit ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Configuration Editor () Ġ= ĠTODO (" mock ") ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun ĠgetState ( executor : ĠExecutor , Ġenvironment : ĠExecution Environment ) Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġclass ĠTest Configuration Type ( val Ġuuid : ĠString ) Ġ: ĠConfiguration Type Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġelements Ġ= ĠTest Configuration Factory ( this , Ġuuid ) ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Icon (): ĠIcon Ġ= ĠAll Icons . Icons . Ide . Next Step ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Configuration Type Description () Ġ= Ġ" mock " ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun ĠgetId () Ġ= Ġuuid ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget DisplayName () Ġ= Ġ" mock " ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Configuration Factories () Ġ= ĠarrayOf < Configuration Factory >( elements ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġrestore Configurations ( run Configuration : ĠRun Configuration ) Ġ{ ĊĠĠĠĠĠĠĠ Ġtask Injector . restore Configurations ( listOf ( run Configuration )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġinject Main fr amer ( run Configuration : ĠRun Configuration ) Ġ{ ĊĠĠĠĠĠĠĠ Ġtask Injector . inject Tool To Configurations ( Main fr amer Task Provider ( project ), ĠlistOf ( run Configuration )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġverify Before Run Tasks ( configuration : ĠRun Configuration ) Ġ= ĠassertThat ( run Manager . get Before Run Tasks ( configuration )) ĊĊĠĠĠ Ġprivate Ġfun Ġrandom String () Ġ= ĠUUID . randomUUID (). toString () Ċ }