/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 5 ĠH ann es ĠD or fm ann Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 5 ĠTick ar oo , ĠInc . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ* Ċ Ġ*/ Ċ Ċ package Ġcom . tick ar oo . tik xml . processor . sc anning Ċ Ċ import Ġcom . google . common . truth . Truth Ċ import Ġcom . google . testing . compile . Java File Objects Ċ import Ġcom . google . testing . compile . Java Source Subject Factory Ċ import Ġcom . google . testing . compile . Java Sources Subject Ċ import Ġcom . tick ar oo . tik xml . Type Converter Ċ import Ġcom . tick ar oo . tik xml . annotation . Attribute Ċ import Ġcom . tick ar oo . tik xml . annotation . Property Element Ċ import Ġcom . tick ar oo . tik xml . annotation . Xml Ċ import Ġcom . tick ar oo . tik xml . processor . Xml Processor Ċ import Ġorg . junit . Test Ċ import Ġjava . util . Date Ċ import Ġjavax . tools . Java FileObject Ċ Ċ /** Ċ Ġ* Ġ@ author ĠH ann es ĠD or fm ann Ċ Ġ*/ Ċ class ĠCustom Type Converter Test Ġ{ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġcustom AttributeType Converter () Ġ{ ĊĠĠĠ Ġval Ġcomponent File Ġ= ĠJava File Objects . for Source Lines (" test . My Date Converter ", ĊĠĠĠĠĠ Ġ" package Ġtest ;", ĊĠĠĠĠĠ Ġ"@ ${ Xml :: class . java . canonical Name }", ĊĠĠĠĠĠ Ġ" class ĠCustom Type Adapter On Attribute Ġ{ ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġ@ ${ Attribute :: class . qualified Name }", ĊĠĠĠĠĠ Ġ" ĠĠ Ġ${ Date :: class . qualified Name } Ġfoo ;", ĊĠĠĠĠĠ Ġ" }", ĊĠĠĠĠĠ Ġ"", ĊĠĠĠĠĠ Ġ" public Ġclass ĠMy Date Converter Ġimplements Ġ${ Type Converter :: class . qualified Name } < ${ Date :: class . qualified Name }>{ ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġpublic Ġ${ Date :: class . qualified Name } Ġread ( String Ġvalue ) Ġthrows ĠException Ġ{ Ġreturn Ġnull ; Ġ} ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġpublic ĠString Ġwrite (${ Date :: class . qualified Name } Ġvalue ) Ġ{ Ġreturn Ġnull ; Ġ} ", ĊĠĠĠĠĠ Ġ" }" ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠTr uth . assert About < Java Sources Subject . Single Source Adapter , ĠJava FileObject >( Java Source Subject Factory . java Source ()) ĊĠĠĠĠĠ Ġ. that ( component File ). processed With ( Xml Processor ()) ĊĠĠĠĠĠ Ġ. comp iles Without Error () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġproperty Type Converter () Ġ{ ĊĠĠĠ Ġval Ġcomponent File Ġ= ĠJava File Objects . for Source Lines (" test . My Date Converter ", ĊĠĠĠĠĠ Ġ" package Ġtest ;", ĊĠĠĠĠĠ Ġ"@ ${ Xml :: class . java . canonical Name }", ĊĠĠĠĠĠ Ġ" class ĠCustom Type Adapter On Attribute Ġ{ ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġ@ ${ Property Element :: class . qualified Name }", ĊĠĠĠĠĠ Ġ" ĠĠ Ġ${ Date :: class . qualified Name } Ġfoo ;", ĊĠĠĠĠĠ Ġ" }", ĊĠĠĠĠĠ Ġ"", ĊĠĠĠĠĠ Ġ" public Ġclass ĠMy Date Converter Ġimplements Ġ${ Type Converter :: class . qualified Name } < ${ Date :: class . qualified Name }>{ ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġpublic Ġ${ Date :: class . qualified Name } Ġread ( String Ġvalue ) Ġthrows ĠException Ġ{ Ġreturn Ġnull ; Ġ} ", ĊĠĠĠĠĠ Ġ" ĠĠ Ġpublic ĠString Ġwrite (${ Date :: class . qualified Name } Ġvalue ) Ġ{ Ġreturn Ġnull ; Ġ} ", ĊĠĠĠĠĠ Ġ" }" ĊĠĠĠ Ġ) ĊĊĠĠĠ ĠTr uth . assert About < Java Sources Subject . Single Source Adapter , ĠJava FileObject >( Java Source Subject Factory . java Source ()) ĊĠĠĠĠĠ Ġ. that ( component File ). processed With ( Xml Processor ()) ĊĠĠĠĠĠ Ġ. comp iles Without Error () ĊĠ Ġ} Ċ } Ċ