package Ġk tx . assets Ċ Ċ import Ġcom . badlogic . gdx . Files . FileType Ċ import Ġcom . badlogic . gdx . assets . loaders . File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Absolute File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Classpath File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . External File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Internal File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Local File Handle Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Resolution File Resolver Ċ import Ġcom . badlogic . gdx . assets . loaders . resolvers . Resolution File Resolver . Resolution Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertSame Ċ import Ġorg . junit . Assert . assertTrue Ċ import Ġorg . junit . Test Ċ Ċ /** Ċ Ġ* ĠTests Ġ[ File Handle Resolver ] Ġutilities . Ċ Ġ*/ Ċ class ĠResolver s Test Ġ{ ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconvert ĠClass path Ġfile Ġtype Ġto ĠClass path File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver : ĠFile Handle Resolver Ġ= ĠFile Type . Classpath . get Resolver () ĊĊĠĠĠ ĠassertTrue ( resolver Ġis ĠClass path File Handle Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconvert ĠInternal Ġfile Ġtype Ġto ĠInternal File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver : ĠFile Handle Resolver Ġ= ĠFile Type . Internal . get Resolver () ĊĊĠĠĠ ĠassertTrue ( resolver Ġis ĠInternal File Handle Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconvert ĠLocal Ġfile Ġtype Ġto ĠLocal File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver : ĠFile Handle Resolver Ġ= ĠFile Type . Local . get Resolver () ĊĊĠĠĠ ĠassertTrue ( resolver Ġis ĠLocal File Handle Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconvert ĠExternal Ġfile Ġtype Ġto ĠExternal File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver : ĠFile Handle Resolver Ġ= ĠFile Type . External . get Resolver () ĊĊĠĠĠ ĠassertTrue ( resolver Ġis ĠExternal File Handle Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconvert ĠAbsolute Ġfile Ġtype Ġto ĠAbsolute File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver : ĠFile Handle Resolver Ġ= ĠFile Type . Absolute . get Resolver () ĊĊĠĠĠ ĠassertTrue ( resolver Ġis ĠAbsolute File Handle Resolver ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġdecor ate ĠFile Handle Resolver Ġwith ĠPrefix File Handle Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver Ġ= ĠInternal File Handle Resolver () ĊĊĠĠĠ Ġval Ġdecor ated Ġ= Ġresolver . with Prefix (" test ") ĊĊĠĠĠ ĠassertSame ( resolver , Ġdecor ated . base Resolver ) ĊĠĠĠ ĠassertEquals (" test ", Ġdecor ated . prefix ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġdecor ate ĠFile Handle Resolver Ġwith ĠResolution File Resolver `() Ġ{ ĊĠĠĠ Ġval Ġresolver Ġ= ĠInternal File Handle Resolver () ĊĊĠĠĠ Ġval Ġdecor ated Ġ= Ġresolver . for Resolution s ( Resolution ( 6 0 0 , Ġ 4 0 0 , Ġ" mock ")) ĊĊĠĠĠ ĠassertSame ( resolver , Ġdecor ated . base Resolver ) ĊĠĠĠ ĠassertEquals ( 1 , Ġdecor ated . resolution s . size ) ĊĠĠĠ Ġval Ġresolution Ġ= Ġdecor ated . resolution s [ 0 ] ĊĠĠĠ ĠassertEquals ( 6 0 0 , Ġresolution . portrait Width ) ĊĠĠĠ ĠassertEquals ( 4 0 0 , Ġresolution . portrait Height ) ĊĠĠĠ ĠassertEquals (" mock ", Ġresolution . folder ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ( expected Ġ= ĠIllegalArgumentException :: class ) ĊĠ Ġfun Ġ` should Ġnot Ġdecor ate ĠFile Handle Resolver Ġwith ĠResolution File Resolver Ġgiven Ġno Ġresolution s `() Ġ{ ĊĠĠĠ Ġval Ġresolver Ġ= ĠInternal File Handle Resolver () ĊĊĠĠĠ Ġresolver . for Resolution s () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconstruct ĠResolution `() Ġ{ ĊĠĠĠ Ġval Ġresolution Ġ= Ġresolution ( width Ġ= Ġ 8 0 0 , Ġheight Ġ= Ġ 6 0 0 , Ġfolder Ġ= Ġ" test ") ĊĊĠĠĠ ĠassertEquals ( 8 0 0 , Ġresolution . portrait Width ) ĊĠĠĠ ĠassertEquals ( 6 0 0 , Ġresolution . portrait Height ) ĊĠĠĠ ĠassertEquals (" test ", Ġresolution . folder ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġconstruct ĠResolution Ġwith Ġdefault Ġfolder Ġname `() Ġ{ ĊĠĠĠ Ġval Ġresolution Ġ= Ġresolution ( width Ġ= Ġ 1 0 2 4 , Ġheight Ġ= Ġ 7 6 8 ) ĊĊĠĠĠ ĠassertEquals ( 1 0 2 4 , Ġresolution . portrait Width ) ĊĠĠĠ ĠassertEquals ( 7 6 8 , Ġresolution . portrait Height ) ĊĠĠĠ ĠassertEquals (" 1 0 2 4 x 7 6 8 ", Ġresolution . folder ) ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠExtract s Ġprotected Ġ[ File Handle Resolver ] Ġfield . ĊĠĠ Ġ*/ ĊĠ Ġval ĠResolution File Resolver . base Resolver : ĠFile Handle Resolver ĊĠĠĠ Ġget () Ġ= ĠResolution File Resolver :: class . java . getDeclared Field (" base Resolver ") ĊĠĠĠĠĠ Ġ. apply Ġ{ Ġis Accessible Ġ= Ġtrue Ġ} ĊĠĠĠĠĠ Ġ. get ( this ) Ġas ĠFile Handle Resolver ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠExtract s Ġprotected Ġ[ Resolution ] Ġarray Ġfield . ĊĠĠ Ġ*/ ĊĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠ Ġval ĠResolution File Resolver . resolution s : ĠArray < Resolution > ĊĠĠĠ Ġget () Ġ= ĠResolution File Resolver :: class . java . getDeclared Field (" descriptors ") ĊĠĠĠĠĠ Ġ. apply Ġ{ Ġis Accessible Ġ= Ġtrue Ġ} ĊĠĠĠĠĠ Ġ. get ( this ) Ġas ĠArray < Resolution > Ċ } Ċ