// ĠCopyright Ġ 2 0 1 9 ĠAmazon . com , ĠInc . Ġor Ġits Ġaffiliates . ĠAll ĠRights ĠReserved . Ċ // ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ċ package Ġsoftware . aws . tool k its . jetbrains . services . cloud debug Ċ Ċ import Ġbase . Aws Re use Solution TestBase Ċ import Ġcom . jetbrains . rd client . util . idea . pump Messages Ċ import Ġcom . jetbrains . r ider . project View . solution Directory Ċ import Ġcom . jetbrains . r ider . test . assert s . shouldBe True Ċ import Ġcom . jetbrains . r ider . test . script ing Api . build Solution With Re Sharper Build Ċ import Ġorg . assertj . core . api . Assertions Ċ import Ġorg . testng . annotations . DataProvider Ċ import Ġorg . testng . annotations . Test Ċ import Ġsoftware . aws . tool k its . jetbrains . services . ecs . execution . Artifact Mapping Ċ import Ġjava . time . Duration Ċ Ċ class ĠDot Net Startup Command Test Ġ: ĠAws Re use Solution TestBase () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġget Solution DirectoryName () Ġ= Ġ" Sam HelloWorld App " ĊĊĠĠĠ Ġprivate Ġval Ġstart Command Ġ= ĠDot Net Startup Command () ĊĊĠĠĠ Ġ@ DataProvider ( name Ġ= Ġ" artifacts Mapping TestData ") ĊĠĠĠ Ġfun Ġartifacts Mapping TestData () Ġ= ĠarrayOf ( ĊĠĠĠĠĠĠĠ ĠarrayOf (" Empty Artifacts Map ", Ġ" original Ġcommand ", ĠArtifact Mapping ()), ĊĠĠĠĠĠĠĠ ĠarrayOf (" Artifacts Map With Local Path Only ", Ġ" original Ġcommand ", ĠArtifact Mapping ( local Path Ġ= Ġ"/ tmp / local / path ")), ĊĠĠĠĠĠĠĠ ĠarrayOf (" Artifacts Map With Remote Path Only ", Ġ" original Ġcommand ", ĠArtifact Mapping ( remote Path Ġ= Ġ"/ tmp / remote / path ")), ĊĠĠĠĠĠĠĠ ĠarrayOf (" Assembly DoesNotExist ", Ġ" original Ġcommand ", ĠArtifact Mapping ( local Path Ġ= Ġ"/ tmp / local / path ", Ġremote Path Ġ= Ġ"/ tmp / remote / path ")) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Test ( dataProvider Ġ= Ġ" artifacts Mapping TestData ") ĊĠĠĠ Ġfun Ġtest Update Startup Command _ Return Original Command ( name : ĠString , Ġoriginal Command : ĠString , Ġartifacts Map : ĠArtifact Mapping ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġcommand Ġ= Ġ"" ĊĠĠĠĠĠĠĠ Ġstart Command . update Startup Command ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproject Ġ= Ġproject , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoriginal Command Ġ= Ġoriginal Command , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġartifact Ġ= Ġartifacts Map , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon Command Get Ġ= Ġ{ Ġcommand Ġ= Ġit Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġpump Messages ( Duration . of Seconds ( 2 ). to Millis ()) Ġ{ Ġcommand . isNotEmpty () Ġ} ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( command ). isEqualTo ( original Command ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Update Command _ Assembly Found _ Update Startup Command () Ġ{ ĊĠĠĠĠĠĠĠ Ġbuild Solution With Re Sharper Build ( project ) ĊĠĠĠĠĠĠĠ Ġval Ġassembly Path Ġ= Ġproject . solution Directory ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" src ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" HelloWorld ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" bin ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" Debug ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" net core app 2 . 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. resolve (" HelloWorld . dll ") ĊĊĠĠĠĠĠĠĠ Ġassembly Path . exists (). shouldBe True (" Failed Ġto Ġfind Ġassembly Ġfile Ġby Ġpath : Ġ'${ assembly Path . canonical Path }' ") ĊĊĠĠĠĠĠĠĠ Ġval Ġoriginal Command Ġ= Ġ" original Ġcommand " ĊĠĠĠĠĠĠĠ Ġvar Ġcommand Ġ= Ġ"" ĊĠĠĠĠĠĠĠ Ġstart Command . update Startup Command ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproject Ġ= Ġproject , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoriginal Command Ġ= Ġoriginal Command , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġartifact Ġ= ĠArtifact Mapping ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlocal Path Ġ= Ġassembly Path . canonical Path , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġremote Path Ġ= Ġ"/ tmp / remote / path " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon Command Get Ġ= Ġ{ Ġcommand Ġ= Ġit Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġpump Messages ( Duration . of Seconds ( 2 ). to Millis ()) Ġ{ Ġcommand . isNotEmpty () Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġexpected Command Ġ= Ġ" dotnet Ġ/ tmp / remote / path / net core app 2 . 1 / HelloWorld . dll " ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( command ). isEqualTo ( expected Command ) ĊĠĠĠ Ġ} Ċ } Ċ