package Ġcom . jetbrains . plugin . structure . hub . mock Ċ Ċ import Ġcom . jetbrains . plugin . structure . base . plugin . Plugin Problem Ċ import Ġcom . jetbrains . plugin . structure . base . problems . Plugin Descriptor Is NotFound Ċ import Ġcom . jetbrains . plugin . structure . base . problems . Plugin FileSize Is Too Large Ċ import Ġcom . jetbrains . plugin . structure . base . problems . Property Not Specified Ċ import Ġcom . jetbrains . plugin . structure . base . utils . content Builder . build Directory Ċ import Ġcom . jetbrains . plugin . structure . base . utils . content Builder . build Zip File Ċ import Ġcom . jetbrains . plugin . structure . base . utils . simple Name Ċ import Ġcom . jetbrains . plugin . structure . hub . Hub Plugin Ċ import Ġcom . jetbrains . plugin . structure . hub . Hub PluginManager Ċ import Ġcom . jetbrains . plugin . structure . hub . problems . Hub Dependencies Not Specified Ċ import Ġcom . jetbrains . plugin . structure . hub . problems . Hub Products Not Specified Ċ import Ġcom . jetbrains . plugin . structure . hub . problems . Hub Zip File Too Many Files Error Ċ import Ġcom . jetbrains . plugin . structure . hub . problems . create Incorrect Hub Plugin File Ċ import Ġcom . jetbrains . plugin . structure . intellij . problems . Too Long PropertyValue Ċ import Ġcom . jetbrains . plugin . structure . mocks . Base PluginManager Test Ċ import Ġcom . jetbrains . plugin . structure . rules . FileSystem Type Ċ import Ġorg . junit . Test Ċ import Ġjava . nio . file . Path Ċ import Ġjava . nio . file . Paths Ċ Ċ class ĠHub Invalid Plugins Test ( file System Type : ĠFileSystem Type ) Ġ: ĠBase PluginManager Test < Hub Plugin , ĠHub PluginManager >( file System Type ) Ġ{ ĊĊĠ Ġoverride Ġfun Ġcreate Manager ( extract Directory : ĠPath ): ĠHub PluginManager Ġ= ĊĠĠĠ ĠHub PluginManager . create Manager ( extract Directory ) ĊĊĠ Ġ@ Test ( expected Ġ= ĠIllegalArgumentException :: class ) ĊĠ Ġfun Ġ` file Ġdoes Ġnot Ġexist `() Ġ{ ĊĠĠĠ Ġassert Problem atic Plugin ( Paths . get (" does - not - exist . zip "), Ġempty List ()) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` invalid Ġfile Ġextension `() Ġ{ ĊĠĠĠ Ġval Ġincorrect Ġ= Ġtemporary Folder . new File (" incorrect . txt ") ĊĠĠĠ Ġassert Problem atic Plugin ( incorrect , ĠlistOf ( create Incorrect Hub Plugin File ( incorrect . simple Name ))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` manifest Ġjson Ġnot Ġfound Ġin Ġdirectory `() Ġ{ ĊĠĠĠ Ġval Ġplugin File Ġ= Ġbuild Directory ( temporary Folder . new Folder (" plugin ")) Ġ{ ĊĠĠĠ Ġ} ĊĠĠĠ Ġassert Problem atic Plugin ( plugin File , ĠlistOf ( Plugin Descriptor Is NotFound ( Hub PluginManager . DESCRIPTOR _ NAME ))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` manifest Ġjson Ġnot Ġfound Ġin Ġzip `() Ġ{ ĊĠĠĠ Ġval Ġplugin File Ġ= Ġbuild Zip File ( temporary Folder . new Folder (). resolve (" plugin . zip ")) Ġ{ ĊĠĠĠ Ġ} ĊĠĠĠ Ġassert Problem atic Plugin ( plugin File , ĠlistOf ( Plugin Descriptor Is NotFound ( Hub PluginManager . DESCRIPTOR _ NAME ))) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcheck Invalid Plugin ( problem : ĠPlugin Problem , Ġdestructor : ĠHub Plugin Json Builder . () Ġ-> ĠUnit ) Ġ{ ĊĠĠĠ Ġval Ġplugin File Ġ= Ġbuild Zip File ( temporary Folder . new Folder (). resolve (" plugin . zip ")) Ġ{ ĊĠĠĠĠĠ Ġfile ( Hub PluginManager . DESCRIPTOR _ NAME ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbuilder Ġ= Ġperfect Hub Plugin Builder ĊĠĠĠĠĠĠĠ Ġbuilder . de structor () ĊĠĠĠĠĠĠĠ Ġbuilder . asString () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġassert Problem atic Plugin ( plugin File , ĠlistOf ( problem )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` key Ġis Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" key ")) Ġ{ Ġkey Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" key ")) Ġ{ Ġkey Ġ= Ġ"" Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` name Ġis Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" name ")) Ġ{ Ġname Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" name ")) Ġ{ Ġname Ġ= Ġ"" Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( ĊĠĠĠĠĠ ĠToo Long PropertyValue ( ĊĠĠĠĠĠĠĠ ĠHub PluginManager . DESCRIPTOR _ NAME , ĊĠĠĠĠĠĠĠ Ġ" name ", ĊĠĠĠĠĠĠĠĠ 6 5 , ĊĠĠĠĠĠĠĠĠ 6 4 ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) Ġ{ Ġname Ġ= Ġ" a ". repeat ( 6 5 ) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` version Ġis Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" version ")) Ġ{ Ġversion Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" version ")) Ġ{ Ġversion Ġ= Ġ"" Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` author Ġis Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" author ")) Ġ{ Ġauthor Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" author ")) Ġ{ Ġauthor Ġ= Ġ"" Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` dependencies Ġare Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" dependencies ")) Ġ{ Ġdependencies Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Hub Dependencies Not Specified ()) Ġ{ Ġdependencies Ġ= Ġempty Map () Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` products Ġare Ġnot Ġspecified `() Ġ{ ĊĠĠĠ Ġcheck Invalid Plugin ( Property Not Specified (" products ")) Ġ{ Ġproducts Ġ= Ġnull Ġ} ĊĠĠĠ Ġcheck Invalid Plugin ( Hub Products Not Specified ()) Ġ{ Ġproducts Ġ= Ġempty Map () Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` too Ġmany Ġfiles Ġin Ġhub Ġplugin `() Ġ{ ĊĠĠĠ Ġval Ġtoo Many Number Ġ= Ġ 1 0 0 1 ĊĊĠĠĠ Ġval Ġplugin File Ġ= Ġbuild Zip File ( temporary Folder . new Folder (). resolve (" plugin . zip ")) Ġ{ ĊĠĠĠĠĠ Ġfile ( Hub PluginManager . DESCRIPTOR _ NAME ) Ġ{ ĊĠĠĠĠĠĠĠ Ġperfect Hub Plugin Builder . modify Ġ{ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ( 0 Ġuntil Ġtoo Many Number ). forEach Ġ{ Ġi Ġ-> ĊĠĠĠĠĠĠĠ Ġfile (" file _$ i . txt ", Ġ"$ i ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġassert Problem atic Plugin ( plugin File , ĠlistOf ( Hub Zip File Too Many Files Error ())) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` too Ġbig Ġhub Ġzip Ġfile `() Ġ{ ĊĠĠĠ Ġval Ġtoo Big Size Ġ= Ġ 3 1 Ġ* Ġ 1 0 2 4 Ġ* Ġ 1 0 2 4 ĊĊĠĠĠ Ġval Ġplugin File Ġ= Ġbuild Zip File ( temporary Folder . new Folder (). resolve (" plugin . zip ")) Ġ{ ĊĠĠĠĠĠ Ġfile ( Hub PluginManager . DESCRIPTOR _ NAME ) Ġ{ ĊĠĠĠĠĠĠĠ Ġperfect Hub Plugin Builder . modify Ġ{ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġfile (" big File . bin ", ĠByteArray ( too Big Size )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġassert Problem atic Plugin ( plugin File , ĠlistOf ( Plugin FileSize Is Too Large ( 3 0 L Ġ* Ġ 1 0 2 4 Ġ* Ġ 1 0 2 4 ))) ĊĠ Ġ} Ċ Ċ }