package Ġcom . tester um . report _ generators . reports . report _ model . json _ model Ċ Ċ import Ġcom . tester um . common _ kotlin . create Directories Ċ import Ġcom . tester um . common _ kotlin . write Text Ċ import Ġcom . tester um . report _ generators . reports . report _ model . base . Base Report Model Execution Listener Ċ import Ġcom . tester um . runner . cmdline . report _ type . builder . EventListener Properties Ċ import Ġjava . nio . file . Paths Ċ import Ġjava . nio . file . Path Ġas ĠJava Path Ċ Ċ class ĠJson Model Execution Listener ( private Ġval Ġproperties : ĠMap < String , ĠString >) Ġ: ĠBase Report Model Execution Listener () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġ_ destination Directory : ĠJava Path Ġ= Ġrun Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdestination Directory Property Ġ= Ġproperties [ EventListener Properties . Json Model . DEST INATION _ DIRECTORY ] ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠIllegalArgumentException (" missing Ġrequired Ġproperty Ġ${ EventListener Properties . Json Model . DEST INATION _ DIRECTORY }") ĊĊĠĠĠĠĠĠĠ Ġreturn @ run ĠPaths . get ( destination Directory Property ). to AbsolutePath (). normalize () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġdestination Directory : ĠJava Path ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ destination Directory ĊĊĠĠĠ Ġprivate Ġval Ġ_ formatted : ĠBoolean Ġ= Ġrun Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġformatted Property Ġ= Ġproperties [ EventListener Properties . Json Model . FORMAT TED ] ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġreturn @ run Ġfalse ĊĊĠĠĠĠĠĠĠ Ġreturn @ run Ġformatted Property . to Boolean () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġformatted : ĠBoolean ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ formatted ĊĊĠĠĠ Ġoverride Ġfun Ġafter Model Saved ToFile () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ// Ġwrite Ġdata Ġfile ĊĠĠĠĠĠĠĠ Ġdestination Directory . create Directories () ĊĠĠĠĠĠĠĠ Ġdestination Directory . resolve ( MODEL _ DEST INATION _ FILE _ NAME ). write Text ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel As Json String ?: Ġthrow ĠRuntimeException (" Data ĠModel Ġshould Ġnot Ġbe Ġnull ") ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ