Helios-SUnit.js 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185
  1. define("helios/Helios-SUnit", ["amber/boot", "helios/Helios-Core"], function($boot){
  2. var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
  3. smalltalk.addPackage('Helios-SUnit');
  4. smalltalk.packages["Helios-SUnit"].transport = {"type":"amd","amdNamespace":"helios"};
  5. smalltalk.addClass('HLMultiSelectToolListWidget', globals.HLToolListWidget, [], 'Helios-SUnit');
  6. globals.HLMultiSelectToolListWidget.comment="This is a list that handles multiple selection";
  7. smalltalk.addMethod(
  8. smalltalk.method({
  9. selector: "activeItemCssClass",
  10. protocol: 'accessing',
  11. fn: function (){
  12. var self=this;
  13. return "selector";
  14. },
  15. args: [],
  16. source: "activeItemCssClass\x0a\x09^'selector'",
  17. messageSends: [],
  18. referencedClasses: []
  19. }),
  20. globals.HLMultiSelectToolListWidget);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "isSelected:",
  24. protocol: 'testing',
  25. fn: function (anObject){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. self._subclassResponsibility();
  29. return self}, function($ctx1) {$ctx1.fill(self,"isSelected:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  30. args: ["anObject"],
  31. source: "isSelected: anObject\x0a\x09self subclassResponsibility",
  32. messageSends: ["subclassResponsibility"],
  33. referencedClasses: []
  34. }),
  35. globals.HLMultiSelectToolListWidget);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "listCssClass",
  39. protocol: 'accessing',
  40. fn: function (){
  41. var self=this;
  42. return "nav nav-multiselect nav-pills nav-stacked";
  43. },
  44. args: [],
  45. source: "listCssClass \x0a\x09^'nav nav-multiselect nav-pills nav-stacked'",
  46. messageSends: [],
  47. referencedClasses: []
  48. }),
  49. globals.HLMultiSelectToolListWidget);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "listCssClassForItem:",
  53. protocol: 'accessing',
  54. fn: function (anObject){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) {
  57. var $2,$4,$3,$1;
  58. $2=($ctx1.supercall = true, globals.HLMultiSelectToolListWidget.superclass.fn.prototype._listCssClassForItem_.apply(_st(self), [anObject]));
  59. $ctx1.supercall = false;
  60. $4=self._isSelected_(anObject);
  61. if(smalltalk.assert($4)){
  62. $3=" active";
  63. } else {
  64. $3="";
  65. };
  66. $1=_st($2).__comma($3);
  67. return $1;
  68. }, function($ctx1) {$ctx1.fill(self,"listCssClassForItem:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  69. args: ["anObject"],
  70. source: "listCssClassForItem: anObject\x0a\x09^(super listCssClassForItem: anObject), ((self isSelected: anObject)\x0a\x09\x09ifTrue: [' active']\x0a\x09\x09ifFalse: ['']).\x0a\x09",
  71. messageSends: [",", "listCssClassForItem:", "ifTrue:ifFalse:", "isSelected:"],
  72. referencedClasses: []
  73. }),
  74. globals.HLMultiSelectToolListWidget);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "reselectItem:",
  78. protocol: 'rendering',
  79. fn: function (anObject){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) {
  82. var $receiver;
  83. if(($receiver = anObject) == null || $receiver.isNil){
  84. return self;
  85. } else {
  86. anObject;
  87. };
  88. self._toggleSelection_(anObject);
  89. return self}, function($ctx1) {$ctx1.fill(self,"reselectItem:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  90. args: ["anObject"],
  91. source: "reselectItem: anObject\x0a\x09anObject ifNil: [^self].\x0a\x09self toggleSelection: anObject",
  92. messageSends: ["ifNil:", "toggleSelection:"],
  93. referencedClasses: []
  94. }),
  95. globals.HLMultiSelectToolListWidget);
  96. smalltalk.addMethod(
  97. smalltalk.method({
  98. selector: "select:",
  99. protocol: 'actions',
  100. fn: function (anObject){
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) {
  103. self._subclassResponsibility();
  104. return self}, function($ctx1) {$ctx1.fill(self,"select:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  105. args: ["anObject"],
  106. source: "select: anObject\x0a\x09self subclassResponsibility",
  107. messageSends: ["subclassResponsibility"],
  108. referencedClasses: []
  109. }),
  110. globals.HLMultiSelectToolListWidget);
  111. smalltalk.addMethod(
  112. smalltalk.method({
  113. selector: "toggleListItem:",
  114. protocol: 'actions',
  115. fn: function (aListItem){
  116. var self=this;
  117. var item;
  118. return smalltalk.withContext(function($ctx1) {
  119. var $1,$receiver;
  120. $1=_st(aListItem)._get_((0));
  121. if(($receiver = $1) == null || $receiver.isNil){
  122. return self;
  123. } else {
  124. $1;
  125. };
  126. item=_st(aListItem)._data_("item");
  127. self._toggleSelection_(item);
  128. return self}, function($ctx1) {$ctx1.fill(self,"toggleListItem:",{aListItem:aListItem,item:item},globals.HLMultiSelectToolListWidget)})},
  129. args: ["aListItem"],
  130. source: "toggleListItem: aListItem\x0a\x09| item |\x0a\x09\x0a\x09(aListItem get: 0) ifNil: [ ^ self ].\x0a\x09\x22Find item\x22\x0a\x09item := aListItem data: 'item'.\x0a\x09self toggleSelection: item",
  131. messageSends: ["ifNil:", "get:", "data:", "toggleSelection:"],
  132. referencedClasses: []
  133. }),
  134. globals.HLMultiSelectToolListWidget);
  135. smalltalk.addMethod(
  136. smalltalk.method({
  137. selector: "toggleSelection:",
  138. protocol: 'actions',
  139. fn: function (anObject){
  140. var self=this;
  141. return smalltalk.withContext(function($ctx1) {
  142. var $1;
  143. $1=self._isSelected_(anObject);
  144. if(smalltalk.assert($1)){
  145. self._unselect_(anObject);
  146. } else {
  147. self._select_(anObject);
  148. };
  149. return self}, function($ctx1) {$ctx1.fill(self,"toggleSelection:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  150. args: ["anObject"],
  151. source: "toggleSelection: anObject\x0a\x09(self isSelected: anObject) \x0a\x09\x09ifTrue: [ self unselect: anObject ]\x0a\x09\x09ifFalse: [self select: anObject ]",
  152. messageSends: ["ifTrue:ifFalse:", "isSelected:", "unselect:", "select:"],
  153. referencedClasses: []
  154. }),
  155. globals.HLMultiSelectToolListWidget);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "unselect:",
  159. protocol: 'actions',
  160. fn: function (anObject){
  161. var self=this;
  162. return smalltalk.withContext(function($ctx1) {
  163. self._subclassResponsibility();
  164. return self}, function($ctx1) {$ctx1.fill(self,"unselect:",{anObject:anObject},globals.HLMultiSelectToolListWidget)})},
  165. args: ["anObject"],
  166. source: "unselect: anObject\x0a\x09self subclassResponsibility",
  167. messageSends: ["subclassResponsibility"],
  168. referencedClasses: []
  169. }),
  170. globals.HLMultiSelectToolListWidget);
  171. smalltalk.addClass('HLSUnitClassesListWidget', globals.HLMultiSelectToolListWidget, [], 'Helios-SUnit');
  172. globals.HLSUnitClassesListWidget.comment="I display a list of classes (subclasses of `TestCase`).";
  173. smalltalk.addMethod(
  174. smalltalk.method({
  175. selector: "buttonsDivCssClass",
  176. protocol: 'accessing',
  177. fn: function (){
  178. var self=this;
  179. return "buttons_bar";
  180. },
  181. args: [],
  182. source: "buttonsDivCssClass\x0a\x09^ 'buttons_bar'",
  183. messageSends: [],
  184. referencedClasses: []
  185. }),
  186. globals.HLSUnitClassesListWidget);
  187. smalltalk.addMethod(
  188. smalltalk.method({
  189. selector: "cssClassForItem:",
  190. protocol: 'accessing',
  191. fn: function (aClass){
  192. var self=this;
  193. return smalltalk.withContext(function($ctx1) {
  194. var $1;
  195. $1=_st(_st(aClass)._theNonMetaClass())._heliosClass();
  196. return $1;
  197. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{aClass:aClass},globals.HLSUnitClassesListWidget)})},
  198. args: ["aClass"],
  199. source: "cssClassForItem: aClass\x09\x0a\x09^ aClass theNonMetaClass heliosClass",
  200. messageSends: ["heliosClass", "theNonMetaClass"],
  201. referencedClasses: []
  202. }),
  203. globals.HLSUnitClassesListWidget);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "initializeItems",
  207. protocol: 'initialization',
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. var $1;
  212. self["@items"]=_st(self["@model"])._testClasses();
  213. $1=self["@items"];
  214. return $1;
  215. }, function($ctx1) {$ctx1.fill(self,"initializeItems",{},globals.HLSUnitClassesListWidget)})},
  216. args: [],
  217. source: "initializeItems\x0a\x09^items := model testClasses ",
  218. messageSends: ["testClasses"],
  219. referencedClasses: []
  220. }),
  221. globals.HLSUnitClassesListWidget);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "isSelected:",
  225. protocol: 'testing',
  226. fn: function (anObject){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) {
  229. var $1;
  230. $1=_st(_st(self["@model"])._selectedClasses())._includes_(anObject);
  231. return $1;
  232. }, function($ctx1) {$ctx1.fill(self,"isSelected:",{anObject:anObject},globals.HLSUnitClassesListWidget)})},
  233. args: ["anObject"],
  234. source: "isSelected: anObject\x0a\x09^model selectedClasses includes: anObject",
  235. messageSends: ["includes:", "selectedClasses"],
  236. referencedClasses: []
  237. }),
  238. globals.HLSUnitClassesListWidget);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "items",
  242. protocol: 'accessing',
  243. fn: function (){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) {
  246. var $2,$1,$receiver;
  247. $2=self["@items"];
  248. if(($receiver = $2) == null || $receiver.isNil){
  249. $1=self._initializeItems();
  250. } else {
  251. $1=$2;
  252. };
  253. return $1;
  254. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLSUnitClassesListWidget)})},
  255. args: [],
  256. source: "items\x0a\x09^ items ifNil: [ self initializeItems ]",
  257. messageSends: ["ifNil:", "initializeItems"],
  258. referencedClasses: []
  259. }),
  260. globals.HLSUnitClassesListWidget);
  261. smalltalk.addMethod(
  262. smalltalk.method({
  263. selector: "label",
  264. protocol: 'accessing',
  265. fn: function (){
  266. var self=this;
  267. return "Classes";
  268. },
  269. args: [],
  270. source: "label\x0a\x09^ 'Classes'",
  271. messageSends: [],
  272. referencedClasses: []
  273. }),
  274. globals.HLSUnitClassesListWidget);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "observeModel",
  278. protocol: 'actions',
  279. fn: function (){
  280. var self=this;
  281. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  282. function $HLPackageUnselected(){return globals.HLPackageUnselected||(typeof HLPackageUnselected=="undefined"?nil:HLPackageUnselected)}
  283. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  284. function $HLClassUnselected(){return globals.HLClassUnselected||(typeof HLClassUnselected=="undefined"?nil:HLClassUnselected)}
  285. return smalltalk.withContext(function($ctx1) {
  286. var $1,$2;
  287. $1=_st(self._model())._announcer();
  288. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  289. $ctx1.sendIdx["on:send:to:"]=1;
  290. _st($1)._on_send_to_($HLPackageUnselected(),"onPackageUnselected:",self);
  291. $ctx1.sendIdx["on:send:to:"]=2;
  292. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  293. $ctx1.sendIdx["on:send:to:"]=3;
  294. $2=_st($1)._on_send_to_($HLClassUnselected(),"onClassUnselected:",self);
  295. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLSUnitClassesListWidget)})},
  296. args: [],
  297. source: "observeModel\x0a self model announcer \x0a\x09\x09on: HLPackageSelected\x0a\x09\x09send: #onPackageSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLPackageUnselected\x0a\x09\x09send: #onPackageUnselected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLClassUnselected\x0a\x09\x09send: #onClassUnselected:\x0a\x09\x09to: self.",
  298. messageSends: ["on:send:to:", "announcer", "model"],
  299. referencedClasses: ["HLPackageSelected", "HLPackageUnselected", "HLClassSelected", "HLClassUnselected"]
  300. }),
  301. globals.HLSUnitClassesListWidget);
  302. smalltalk.addMethod(
  303. smalltalk.method({
  304. selector: "observeSystem",
  305. protocol: 'actions',
  306. fn: function (){
  307. var self=this;
  308. function $ClassAdded(){return globals.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  309. return smalltalk.withContext(function($ctx1) {
  310. _st(_st(self._model())._systemAnnouncer())._on_send_to_($ClassAdded(),"onClassAdded:",self);
  311. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLSUnitClassesListWidget)})},
  312. args: [],
  313. source: "observeSystem\x0a self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self.",
  314. messageSends: ["on:send:to:", "systemAnnouncer", "model"],
  315. referencedClasses: ["ClassAdded"]
  316. }),
  317. globals.HLSUnitClassesListWidget);
  318. smalltalk.addMethod(
  319. smalltalk.method({
  320. selector: "onClassAdded:",
  321. protocol: 'reactions',
  322. fn: function (anAnnouncement){
  323. var self=this;
  324. return smalltalk.withContext(function($ctx1) {
  325. var $1,$2;
  326. $1=_st(_st(self._model())._selectedPackages())._includes_(_st(_st(anAnnouncement)._theClass())._package());
  327. if(smalltalk.assert($1)){
  328. self._initializeItems();
  329. $2=self._refresh();
  330. $2;
  331. };
  332. return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{anAnnouncement:anAnnouncement},globals.HLSUnitClassesListWidget)})},
  333. args: ["anAnnouncement"],
  334. source: "onClassAdded: anAnnouncement\x09\x0a\x09(self model selectedPackages includes: anAnnouncement theClass package)\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09initializeItems;\x0a\x09\x09\x09\x09refresh ]",
  335. messageSends: ["ifTrue:", "includes:", "selectedPackages", "model", "package", "theClass", "initializeItems", "refresh"],
  336. referencedClasses: []
  337. }),
  338. globals.HLSUnitClassesListWidget);
  339. smalltalk.addMethod(
  340. smalltalk.method({
  341. selector: "onClassSelected:",
  342. protocol: 'reactions',
  343. fn: function (anAnnouncement){
  344. var self=this;
  345. var listItem;
  346. return smalltalk.withContext(function($ctx1) {
  347. listItem=self._findListItemFor_(_st(anAnnouncement)._item());
  348. _st(listItem)._addClass_("active");
  349. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,listItem:listItem},globals.HLSUnitClassesListWidget)})},
  350. args: ["anAnnouncement"],
  351. source: "onClassSelected: anAnnouncement\x0a\x09| listItem |\x0a\x09listItem := self findListItemFor: anAnnouncement item.\x0a\x09listItem addClass: 'active'.",
  352. messageSends: ["findListItemFor:", "item", "addClass:"],
  353. referencedClasses: []
  354. }),
  355. globals.HLSUnitClassesListWidget);
  356. smalltalk.addMethod(
  357. smalltalk.method({
  358. selector: "onClassUnselected:",
  359. protocol: 'reactions',
  360. fn: function (anAnnouncement){
  361. var self=this;
  362. var listItem;
  363. return smalltalk.withContext(function($ctx1) {
  364. listItem=self._findListItemFor_(_st(anAnnouncement)._item());
  365. _st(listItem)._removeClass_("active");
  366. return self}, function($ctx1) {$ctx1.fill(self,"onClassUnselected:",{anAnnouncement:anAnnouncement,listItem:listItem},globals.HLSUnitClassesListWidget)})},
  367. args: ["anAnnouncement"],
  368. source: "onClassUnselected: anAnnouncement\x0a\x09| listItem |\x0a\x09listItem := self findListItemFor: anAnnouncement item.\x0a\x09listItem removeClass: 'active'.",
  369. messageSends: ["findListItemFor:", "item", "removeClass:"],
  370. referencedClasses: []
  371. }),
  372. globals.HLSUnitClassesListWidget);
  373. smalltalk.addMethod(
  374. smalltalk.method({
  375. selector: "onPackageSelected:",
  376. protocol: 'reactions',
  377. fn: function (anAnnouncement){
  378. var self=this;
  379. return smalltalk.withContext(function($ctx1) {
  380. var $1;
  381. self._initializeItems();
  382. $1=self._refresh();
  383. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement},globals.HLSUnitClassesListWidget)})},
  384. args: ["anAnnouncement"],
  385. source: "onPackageSelected: anAnnouncement\x0a\x09self initializeItems;\x0a\x09\x09refresh",
  386. messageSends: ["initializeItems", "refresh"],
  387. referencedClasses: []
  388. }),
  389. globals.HLSUnitClassesListWidget);
  390. smalltalk.addMethod(
  391. smalltalk.method({
  392. selector: "onPackageUnselected:",
  393. protocol: 'reactions',
  394. fn: function (anAnnouncement){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx1) {
  397. var $1;
  398. self._initializeItems();
  399. $1=self._refresh();
  400. return self}, function($ctx1) {$ctx1.fill(self,"onPackageUnselected:",{anAnnouncement:anAnnouncement},globals.HLSUnitClassesListWidget)})},
  401. args: ["anAnnouncement"],
  402. source: "onPackageUnselected: anAnnouncement\x0a\x09self initializeItems;\x0a\x09\x09refresh",
  403. messageSends: ["initializeItems", "refresh"],
  404. referencedClasses: []
  405. }),
  406. globals.HLSUnitClassesListWidget);
  407. smalltalk.addMethod(
  408. smalltalk.method({
  409. selector: "renderButtonsOn:",
  410. protocol: 'rendering',
  411. fn: function (html){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) {
  414. var $1,$2;
  415. $1=_st(html)._button();
  416. _st($1)._class_("button");
  417. _st($1)._with_("Select all");
  418. $2=_st($1)._onClick_((function(){
  419. return smalltalk.withContext(function($ctx2) {
  420. return _st(self._model())._selectAllClasses();
  421. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  422. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLSUnitClassesListWidget)})},
  423. args: ["html"],
  424. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09\x09class: 'button'; \x0a\x09\x09with: 'Select all';\x0a\x09\x09onClick: [ self model selectAllClasses ]",
  425. messageSends: ["class:", "button", "with:", "onClick:", "selectAllClasses", "model"],
  426. referencedClasses: []
  427. }),
  428. globals.HLSUnitClassesListWidget);
  429. smalltalk.addMethod(
  430. smalltalk.method({
  431. selector: "renderItemLabel:on:",
  432. protocol: 'rendering',
  433. fn: function (aClass,html){
  434. var self=this;
  435. return smalltalk.withContext(function($ctx1) {
  436. _st(html)._with_(_st(aClass)._name());
  437. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{aClass:aClass,html:html},globals.HLSUnitClassesListWidget)})},
  438. args: ["aClass", "html"],
  439. source: "renderItemLabel: aClass on: html\x0a\x09html with: aClass name",
  440. messageSends: ["with:", "name"],
  441. referencedClasses: []
  442. }),
  443. globals.HLSUnitClassesListWidget);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "select:",
  447. protocol: 'actions',
  448. fn: function (anObject){
  449. var self=this;
  450. return smalltalk.withContext(function($ctx1) {
  451. _st(self["@model"])._selectClass_(anObject);
  452. return self}, function($ctx1) {$ctx1.fill(self,"select:",{anObject:anObject},globals.HLSUnitClassesListWidget)})},
  453. args: ["anObject"],
  454. source: "select: anObject\x0a\x09model selectClass: anObject",
  455. messageSends: ["selectClass:"],
  456. referencedClasses: []
  457. }),
  458. globals.HLSUnitClassesListWidget);
  459. smalltalk.addMethod(
  460. smalltalk.method({
  461. selector: "unselect:",
  462. protocol: 'actions',
  463. fn: function (anObject){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) {
  466. _st(self["@model"])._unselectClass_(anObject);
  467. return self}, function($ctx1) {$ctx1.fill(self,"unselect:",{anObject:anObject},globals.HLSUnitClassesListWidget)})},
  468. args: ["anObject"],
  469. source: "unselect: anObject\x0a\x09model unselectClass: anObject",
  470. messageSends: ["unselectClass:"],
  471. referencedClasses: []
  472. }),
  473. globals.HLSUnitClassesListWidget);
  474. smalltalk.addClass('HLSUnitPackagesListWidget', globals.HLMultiSelectToolListWidget, [], 'Helios-SUnit');
  475. globals.HLSUnitPackagesListWidget.comment="I display a list of packages for which unit tests are associated (packages containing subclasses of `TestCase`).";
  476. smalltalk.addMethod(
  477. smalltalk.method({
  478. selector: "buttonsDivCssClass",
  479. protocol: 'accessing',
  480. fn: function (){
  481. var self=this;
  482. return "buttons_bar";
  483. },
  484. args: [],
  485. source: "buttonsDivCssClass\x0a\x09^ 'buttons_bar'",
  486. messageSends: [],
  487. referencedClasses: []
  488. }),
  489. globals.HLSUnitPackagesListWidget);
  490. smalltalk.addMethod(
  491. smalltalk.method({
  492. selector: "cssClassForItem:",
  493. protocol: 'accessing',
  494. fn: function (anItem){
  495. var self=this;
  496. return smalltalk.withContext(function($ctx1) {
  497. var $2,$1;
  498. $2=_st(anItem)._isDirty();
  499. if(smalltalk.assert($2)){
  500. $1="package_dirty";
  501. } else {
  502. $1="package";
  503. };
  504. return $1;
  505. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anItem:anItem},globals.HLSUnitPackagesListWidget)})},
  506. args: ["anItem"],
  507. source: "cssClassForItem: anItem\x09\x0a\x09^ anItem isDirty \x0a\x09\x09ifTrue: [ 'package_dirty' ]\x0a\x09\x09ifFalse: [ 'package' ]",
  508. messageSends: ["ifTrue:ifFalse:", "isDirty"],
  509. referencedClasses: []
  510. }),
  511. globals.HLSUnitPackagesListWidget);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "initializeItems",
  515. protocol: 'initialization',
  516. fn: function (){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) {
  519. var $2,$1;
  520. self["@items"]=_st(_st(self["@model"])._testPackages())._sort_((function(a,b){
  521. return smalltalk.withContext(function($ctx2) {
  522. $2=_st(a)._name();
  523. $ctx2.sendIdx["name"]=1;
  524. return _st($2).__lt(_st(b)._name());
  525. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)})}));
  526. $1=self["@items"];
  527. return $1;
  528. }, function($ctx1) {$ctx1.fill(self,"initializeItems",{},globals.HLSUnitPackagesListWidget)})},
  529. args: [],
  530. source: "initializeItems\x0a\x09^items := model testPackages \x0a\x09\x09sort: [:a :b | a name < b name]",
  531. messageSends: ["sort:", "testPackages", "<", "name"],
  532. referencedClasses: []
  533. }),
  534. globals.HLSUnitPackagesListWidget);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "isSelected:",
  538. protocol: 'testing',
  539. fn: function (anObject){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. var $1;
  543. $1=_st(_st(self["@model"])._selectedPackages())._includes_(anObject);
  544. return $1;
  545. }, function($ctx1) {$ctx1.fill(self,"isSelected:",{anObject:anObject},globals.HLSUnitPackagesListWidget)})},
  546. args: ["anObject"],
  547. source: "isSelected: anObject\x0a\x09^model selectedPackages includes: anObject",
  548. messageSends: ["includes:", "selectedPackages"],
  549. referencedClasses: []
  550. }),
  551. globals.HLSUnitPackagesListWidget);
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "items",
  555. protocol: 'accessing',
  556. fn: function (){
  557. var self=this;
  558. return smalltalk.withContext(function($ctx1) {
  559. var $2,$1,$receiver;
  560. $2=self["@items"];
  561. if(($receiver = $2) == null || $receiver.isNil){
  562. $1=self._initializeItems();
  563. } else {
  564. $1=$2;
  565. };
  566. return $1;
  567. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLSUnitPackagesListWidget)})},
  568. args: [],
  569. source: "items\x0a\x09^ items ifNil: [ self initializeItems ]",
  570. messageSends: ["ifNil:", "initializeItems"],
  571. referencedClasses: []
  572. }),
  573. globals.HLSUnitPackagesListWidget);
  574. smalltalk.addMethod(
  575. smalltalk.method({
  576. selector: "label",
  577. protocol: 'accessing',
  578. fn: function (){
  579. var self=this;
  580. return "Packages";
  581. },
  582. args: [],
  583. source: "label\x0a\x09^ 'Packages'",
  584. messageSends: [],
  585. referencedClasses: []
  586. }),
  587. globals.HLSUnitPackagesListWidget);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "observeModel",
  591. protocol: 'actions',
  592. fn: function (){
  593. var self=this;
  594. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  595. function $HLPackageUnselected(){return globals.HLPackageUnselected||(typeof HLPackageUnselected=="undefined"?nil:HLPackageUnselected)}
  596. return smalltalk.withContext(function($ctx1) {
  597. var $1,$2;
  598. $1=_st(self._model())._announcer();
  599. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  600. $ctx1.sendIdx["on:send:to:"]=1;
  601. $2=_st($1)._on_send_to_($HLPackageUnselected(),"onPackageUnselected:",self);
  602. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLSUnitPackagesListWidget)})},
  603. args: [],
  604. source: "observeModel\x0a self model announcer \x0a\x09\x09on: HLPackageSelected\x0a\x09\x09send: #onPackageSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLPackageUnselected\x0a\x09\x09send: #onPackageUnselected:\x0a\x09\x09to: self",
  605. messageSends: ["on:send:to:", "announcer", "model"],
  606. referencedClasses: ["HLPackageSelected", "HLPackageUnselected"]
  607. }),
  608. globals.HLSUnitPackagesListWidget);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "observeSystem",
  612. protocol: 'actions',
  613. fn: function (){
  614. var self=this;
  615. function $ClassAdded(){return globals.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
  616. return smalltalk.withContext(function($ctx1) {
  617. _st(_st(self._model())._systemAnnouncer())._on_send_to_($ClassAdded(),"onClassAdded:",self);
  618. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLSUnitPackagesListWidget)})},
  619. args: [],
  620. source: "observeSystem\x0a self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self.",
  621. messageSends: ["on:send:to:", "systemAnnouncer", "model"],
  622. referencedClasses: ["ClassAdded"]
  623. }),
  624. globals.HLSUnitPackagesListWidget);
  625. smalltalk.addMethod(
  626. smalltalk.method({
  627. selector: "onClassAdded:",
  628. protocol: 'reactions',
  629. fn: function (anAnnouncement){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) {
  632. var $4,$6,$5,$3,$2,$1,$7;
  633. $4=self._items();
  634. $6=_st(anAnnouncement)._theClass();
  635. $ctx1.sendIdx["theClass"]=1;
  636. $5=_st($6)._package();
  637. $ctx1.sendIdx["package"]=1;
  638. $3=_st($4)._includes_($5);
  639. $2=_st($3)._not();
  640. $1=_st($2)._and_((function(){
  641. return smalltalk.withContext(function($ctx2) {
  642. return _st(_st(_st(anAnnouncement)._theClass())._package())._isTestPackage();
  643. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  644. if(smalltalk.assert($1)){
  645. self._initializeItems();
  646. $7=self._refresh();
  647. $7;
  648. };
  649. return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{anAnnouncement:anAnnouncement},globals.HLSUnitPackagesListWidget)})},
  650. args: ["anAnnouncement"],
  651. source: "onClassAdded: anAnnouncement\x0a\x09((self items includes: anAnnouncement theClass package) not and: [anAnnouncement theClass package isTestPackage])\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09initializeItems;\x0a\x09\x09\x09\x09refresh ]",
  652. messageSends: ["ifTrue:", "and:", "not", "includes:", "items", "package", "theClass", "isTestPackage", "initializeItems", "refresh"],
  653. referencedClasses: []
  654. }),
  655. globals.HLSUnitPackagesListWidget);
  656. smalltalk.addMethod(
  657. smalltalk.method({
  658. selector: "onPackageSelected:",
  659. protocol: 'reactions',
  660. fn: function (anAnnouncement){
  661. var self=this;
  662. var listItem;
  663. return smalltalk.withContext(function($ctx1) {
  664. listItem=self._findListItemFor_(_st(anAnnouncement)._item());
  665. _st(listItem)._addClass_("active");
  666. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,listItem:listItem},globals.HLSUnitPackagesListWidget)})},
  667. args: ["anAnnouncement"],
  668. source: "onPackageSelected: anAnnouncement\x0a\x09| listItem |\x0a\x09listItem := self findListItemFor: anAnnouncement item.\x0a\x09listItem addClass: 'active'.\x0a\x09",
  669. messageSends: ["findListItemFor:", "item", "addClass:"],
  670. referencedClasses: []
  671. }),
  672. globals.HLSUnitPackagesListWidget);
  673. smalltalk.addMethod(
  674. smalltalk.method({
  675. selector: "onPackageUnselected:",
  676. protocol: 'reactions',
  677. fn: function (anAnnouncement){
  678. var self=this;
  679. var listItem;
  680. return smalltalk.withContext(function($ctx1) {
  681. listItem=self._findListItemFor_(_st(anAnnouncement)._item());
  682. _st(listItem)._removeClass_("active");
  683. return self}, function($ctx1) {$ctx1.fill(self,"onPackageUnselected:",{anAnnouncement:anAnnouncement,listItem:listItem},globals.HLSUnitPackagesListWidget)})},
  684. args: ["anAnnouncement"],
  685. source: "onPackageUnselected: anAnnouncement\x0a\x09| listItem |\x0a\x09listItem := self findListItemFor: anAnnouncement item.\x0a\x09listItem removeClass: 'active'.",
  686. messageSends: ["findListItemFor:", "item", "removeClass:"],
  687. referencedClasses: []
  688. }),
  689. globals.HLSUnitPackagesListWidget);
  690. smalltalk.addMethod(
  691. smalltalk.method({
  692. selector: "renderButtonsOn:",
  693. protocol: 'rendering',
  694. fn: function (html){
  695. var self=this;
  696. return smalltalk.withContext(function($ctx1) {
  697. var $1,$3,$2,$4,$5;
  698. $1=_st(html)._button();
  699. $ctx1.sendIdx["button"]=1;
  700. _st($1)._class_("button");
  701. $ctx1.sendIdx["class:"]=1;
  702. _st($1)._with_("Run Tests");
  703. $ctx1.sendIdx["with:"]=1;
  704. $2=_st($1)._onClick_((function(){
  705. return smalltalk.withContext(function($ctx2) {
  706. $3=self._model();
  707. $ctx2.sendIdx["model"]=1;
  708. return _st($3)._runTests();
  709. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  710. $ctx1.sendIdx["onClick:"]=1;
  711. $4=_st(html)._button();
  712. _st($4)._class_("button");
  713. _st($4)._with_("Select all");
  714. $5=_st($4)._onClick_((function(){
  715. return smalltalk.withContext(function($ctx2) {
  716. return _st(self._model())._selectAllPackages();
  717. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  718. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLSUnitPackagesListWidget)})},
  719. args: ["html"],
  720. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Run Tests';\x0a\x09\x09onClick: [ self model runTests ].\x0a\x09html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Select all';\x0a\x09\x09onClick: [ self model selectAllPackages ]",
  721. messageSends: ["class:", "button", "with:", "onClick:", "runTests", "model", "selectAllPackages"],
  722. referencedClasses: []
  723. }),
  724. globals.HLSUnitPackagesListWidget);
  725. smalltalk.addMethod(
  726. smalltalk.method({
  727. selector: "renderItemLabel:on:",
  728. protocol: 'rendering',
  729. fn: function (aPackage,html){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) {
  732. _st(html)._with_(_st(aPackage)._name());
  733. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{aPackage:aPackage,html:html},globals.HLSUnitPackagesListWidget)})},
  734. args: ["aPackage", "html"],
  735. source: "renderItemLabel: aPackage on: html\x0a\x09html with: aPackage name",
  736. messageSends: ["with:", "name"],
  737. referencedClasses: []
  738. }),
  739. globals.HLSUnitPackagesListWidget);
  740. smalltalk.addMethod(
  741. smalltalk.method({
  742. selector: "select:",
  743. protocol: 'actions',
  744. fn: function (anObject){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) {
  747. _st(self["@model"])._selectPackage_(anObject);
  748. return self}, function($ctx1) {$ctx1.fill(self,"select:",{anObject:anObject},globals.HLSUnitPackagesListWidget)})},
  749. args: ["anObject"],
  750. source: "select: anObject\x0a\x09model selectPackage: anObject",
  751. messageSends: ["selectPackage:"],
  752. referencedClasses: []
  753. }),
  754. globals.HLSUnitPackagesListWidget);
  755. smalltalk.addMethod(
  756. smalltalk.method({
  757. selector: "unselect:",
  758. protocol: 'actions',
  759. fn: function (anObject){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) {
  762. _st(self["@model"])._unselectPackage_(anObject);
  763. return self}, function($ctx1) {$ctx1.fill(self,"unselect:",{anObject:anObject},globals.HLSUnitPackagesListWidget)})},
  764. args: ["anObject"],
  765. source: "unselect: anObject\x0a\x09model unselectPackage: anObject",
  766. messageSends: ["unselectPackage:"],
  767. referencedClasses: []
  768. }),
  769. globals.HLSUnitPackagesListWidget);
  770. smalltalk.addClass('HLSUnit', globals.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'resultWidget', 'failuresWidget', 'errorsWidget'], 'Helios-SUnit');
  771. globals.HLSUnit.comment="I am the main widget for running unit tests in Helios.\x0a\x0aI provide the ability to select set of tests to run per package, and a detailed result log with passed tests, failed tests and errors.";
  772. smalltalk.addMethod(
  773. smalltalk.method({
  774. selector: "classesListWidget",
  775. protocol: 'widgets',
  776. fn: function (){
  777. var self=this;
  778. function $HLSUnitClassesListWidget(){return globals.HLSUnitClassesListWidget||(typeof HLSUnitClassesListWidget=="undefined"?nil:HLSUnitClassesListWidget)}
  779. return smalltalk.withContext(function($ctx1) {
  780. var $2,$1,$receiver;
  781. $2=self["@classesListWidget"];
  782. if(($receiver = $2) == null || $receiver.isNil){
  783. self["@classesListWidget"]=_st($HLSUnitClassesListWidget())._on_(self._model());
  784. self["@classesListWidget"];
  785. $1=_st(self["@classesListWidget"])._next_(self._failuresWidget());
  786. } else {
  787. $1=$2;
  788. };
  789. return $1;
  790. }, function($ctx1) {$ctx1.fill(self,"classesListWidget",{},globals.HLSUnit)})},
  791. args: [],
  792. source: "classesListWidget\x0a\x09^ classesListWidget ifNil: [ \x0a\x09\x09classesListWidget := HLSUnitClassesListWidget on: self model.\x0a\x09\x09classesListWidget next: self failuresWidget ]",
  793. messageSends: ["ifNil:", "on:", "model", "next:", "failuresWidget"],
  794. referencedClasses: ["HLSUnitClassesListWidget"]
  795. }),
  796. globals.HLSUnit);
  797. smalltalk.addMethod(
  798. smalltalk.method({
  799. selector: "errorsWidget",
  800. protocol: 'widgets',
  801. fn: function (){
  802. var self=this;
  803. function $HLSUnitErrorsListWidget(){return globals.HLSUnitErrorsListWidget||(typeof HLSUnitErrorsListWidget=="undefined"?nil:HLSUnitErrorsListWidget)}
  804. return smalltalk.withContext(function($ctx1) {
  805. var $2,$1,$receiver;
  806. $2=self["@errorsWidget"];
  807. if(($receiver = $2) == null || $receiver.isNil){
  808. self["@errorsWidget"]=_st($HLSUnitErrorsListWidget())._on_(self._model());
  809. $1=self["@errorsWidget"];
  810. } else {
  811. $1=$2;
  812. };
  813. return $1;
  814. }, function($ctx1) {$ctx1.fill(self,"errorsWidget",{},globals.HLSUnit)})},
  815. args: [],
  816. source: "errorsWidget\x0a\x09^ errorsWidget ifNil: [errorsWidget := HLSUnitErrorsListWidget on: self model]",
  817. messageSends: ["ifNil:", "on:", "model"],
  818. referencedClasses: ["HLSUnitErrorsListWidget"]
  819. }),
  820. globals.HLSUnit);
  821. smalltalk.addMethod(
  822. smalltalk.method({
  823. selector: "failuresWidget",
  824. protocol: 'widgets',
  825. fn: function (){
  826. var self=this;
  827. function $HLSUnitFailuresListWidget(){return globals.HLSUnitFailuresListWidget||(typeof HLSUnitFailuresListWidget=="undefined"?nil:HLSUnitFailuresListWidget)}
  828. return smalltalk.withContext(function($ctx1) {
  829. var $2,$1,$receiver;
  830. $2=self["@failuresWidget"];
  831. if(($receiver = $2) == null || $receiver.isNil){
  832. self["@failuresWidget"]=_st($HLSUnitFailuresListWidget())._on_(self._model());
  833. self["@failuresWidget"];
  834. $1=_st(self["@failuresWidget"])._next_(self._errorsWidget());
  835. } else {
  836. $1=$2;
  837. };
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"failuresWidget",{},globals.HLSUnit)})},
  840. args: [],
  841. source: "failuresWidget\x0a\x09^ failuresWidget ifNil: [\x0a\x09\x09failuresWidget := HLSUnitFailuresListWidget on: self model.\x0a\x09\x09failuresWidget next: self errorsWidget]\x0a\x09",
  842. messageSends: ["ifNil:", "on:", "model", "next:", "errorsWidget"],
  843. referencedClasses: ["HLSUnitFailuresListWidget"]
  844. }),
  845. globals.HLSUnit);
  846. smalltalk.addMethod(
  847. smalltalk.method({
  848. selector: "model",
  849. protocol: 'accessing',
  850. fn: function (){
  851. var self=this;
  852. function $HLSUnitModel(){return globals.HLSUnitModel||(typeof HLSUnitModel=="undefined"?nil:HLSUnitModel)}
  853. return smalltalk.withContext(function($ctx1) {
  854. var $2,$1;
  855. $2=self["@model"];
  856. if(($receiver = $2) == nil || $receiver == null){
  857. self["@model"]=_st($HLSUnitModel())._new();
  858. $1=self["@model"];
  859. } else {
  860. $1=$2;
  861. };
  862. return $1;
  863. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLSUnit)})},
  864. args: [],
  865. source: "model\x0a\x09^ model ifNil: [ model := HLSUnitModel new ]",
  866. messageSends: ["ifNil:", "new"],
  867. referencedClasses: ["HLSUnitModel"]
  868. }),
  869. globals.HLSUnit);
  870. smalltalk.addMethod(
  871. smalltalk.method({
  872. selector: "packagesListWidget",
  873. protocol: 'widgets',
  874. fn: function (){
  875. var self=this;
  876. function $HLSUnitPackagesListWidget(){return globals.HLSUnitPackagesListWidget||(typeof HLSUnitPackagesListWidget=="undefined"?nil:HLSUnitPackagesListWidget)}
  877. return smalltalk.withContext(function($ctx1) {
  878. var $2,$1,$receiver;
  879. $2=self["@packagesListWidget"];
  880. if(($receiver = $2) == null || $receiver.isNil){
  881. self["@packagesListWidget"]=_st($HLSUnitPackagesListWidget())._on_(self._model());
  882. self["@packagesListWidget"];
  883. $1=_st(self["@packagesListWidget"])._next_(self._classesListWidget());
  884. } else {
  885. $1=$2;
  886. };
  887. return $1;
  888. }, function($ctx1) {$ctx1.fill(self,"packagesListWidget",{},globals.HLSUnit)})},
  889. args: [],
  890. source: "packagesListWidget\x0a\x09^ packagesListWidget ifNil: [ \x0a\x09\x09packagesListWidget := HLSUnitPackagesListWidget on: self model.\x0a\x09\x09packagesListWidget next: self classesListWidget]",
  891. messageSends: ["ifNil:", "on:", "model", "next:", "classesListWidget"],
  892. referencedClasses: ["HLSUnitPackagesListWidget"]
  893. }),
  894. globals.HLSUnit);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "registerBindingsOn:",
  898. protocol: 'keybindings',
  899. fn: function (aBindingGroup){
  900. var self=this;
  901. function $HLToolCommand(){return globals.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  902. return smalltalk.withContext(function($ctx1) {
  903. _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model());
  904. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},globals.HLSUnit)})},
  905. args: ["aBindingGroup"],
  906. source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
  907. messageSends: ["registerConcreteClassesOn:for:", "model"],
  908. referencedClasses: ["HLToolCommand"]
  909. }),
  910. globals.HLSUnit);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "renderContentOn:",
  914. protocol: 'rendering',
  915. fn: function (html){
  916. var self=this;
  917. var resultSection;
  918. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  919. function $HLVerticalSplitter(){return globals.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  920. return smalltalk.withContext(function($ctx1) {
  921. var $4,$3,$5,$2,$1;
  922. $4=self._packagesListWidget();
  923. $ctx1.sendIdx["packagesListWidget"]=1;
  924. $3=_st($HLVerticalSplitter())._with_with_($4,self._classesListWidget());
  925. resultSection=self._resultSection();
  926. $5=resultSection;
  927. $2=_st($HLVerticalSplitter())._with_with_($3,$5);
  928. $ctx1.sendIdx["with:with:"]=1;
  929. $1=_st($HLContainer())._with_($2);
  930. _st(html)._with_($1);
  931. $ctx1.sendIdx["with:"]=1;
  932. _st((function(){
  933. return smalltalk.withContext(function($ctx2) {
  934. return _st(resultSection)._resize_((0));
  935. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((100));
  936. _st(self._packagesListWidget())._focus();
  937. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,resultSection:resultSection},globals.HLSUnit)})},
  938. args: ["html"],
  939. source: "renderContentOn: html\x0a\x09| resultSection |\x0a\x09html with: (HLContainer with: (\x0a\x09\x09HLVerticalSplitter \x0a\x09\x09\x09with: (HLVerticalSplitter\x0a\x09\x09\x09\x09with: self packagesListWidget \x0a \x09\x09with: self classesListWidget)\x0a\x09\x09\x09with: (resultSection := self resultSection))).\x0a\x09\x0a\x09[resultSection resize: 0] valueWithTimeout: 100.\x0a\x09\x0a\x09self packagesListWidget focus",
  940. messageSends: ["with:", "with:with:", "packagesListWidget", "classesListWidget", "resultSection", "valueWithTimeout:", "resize:", "focus"],
  941. referencedClasses: ["HLContainer", "HLVerticalSplitter"]
  942. }),
  943. globals.HLSUnit);
  944. smalltalk.addMethod(
  945. smalltalk.method({
  946. selector: "resultSection",
  947. protocol: 'accessing',
  948. fn: function (){
  949. var self=this;
  950. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  951. return smalltalk.withContext(function($ctx1) {
  952. var $1;
  953. $1=_st($HLHorizontalSplitter())._with_with_(self._resultWidget(),_st($HLHorizontalSplitter())._with_with_(self._failuresWidget(),self._errorsWidget()));
  954. $ctx1.sendIdx["with:with:"]=1;
  955. return $1;
  956. }, function($ctx1) {$ctx1.fill(self,"resultSection",{},globals.HLSUnit)})},
  957. args: [],
  958. source: "resultSection\x0a\x09^HLHorizontalSplitter \x0a\x09\x09with: self resultWidget\x0a\x09\x09with: (HLHorizontalSplitter \x0a\x09\x09\x09with: self failuresWidget\x0a\x09\x09\x09with: self errorsWidget)",
  959. messageSends: ["with:with:", "resultWidget", "failuresWidget", "errorsWidget"],
  960. referencedClasses: ["HLHorizontalSplitter"]
  961. }),
  962. globals.HLSUnit);
  963. smalltalk.addMethod(
  964. smalltalk.method({
  965. selector: "resultWidget",
  966. protocol: 'widgets',
  967. fn: function (){
  968. var self=this;
  969. function $HLSUnitResults(){return globals.HLSUnitResults||(typeof HLSUnitResults=="undefined"?nil:HLSUnitResults)}
  970. return smalltalk.withContext(function($ctx1) {
  971. var $2,$3,$4,$1,$receiver;
  972. $2=self["@resultWidget"];
  973. if(($receiver = $2) == null || $receiver.isNil){
  974. $3=_st($HLSUnitResults())._new();
  975. _st($3)._model_(self._model());
  976. $4=_st($3)._yourself();
  977. self["@resultWidget"]=$4;
  978. $1=self["@resultWidget"];
  979. } else {
  980. $1=$2;
  981. };
  982. return $1;
  983. }, function($ctx1) {$ctx1.fill(self,"resultWidget",{},globals.HLSUnit)})},
  984. args: [],
  985. source: "resultWidget\x0a\x09^ resultWidget ifNil: [\x0a\x09\x09resultWidget := HLSUnitResults new\x0a\x09\x09\x09model: self model;\x0a\x09\x09\x09yourself]",
  986. messageSends: ["ifNil:", "model:", "new", "model", "yourself"],
  987. referencedClasses: ["HLSUnitResults"]
  988. }),
  989. globals.HLSUnit);
  990. smalltalk.addMethod(
  991. smalltalk.method({
  992. selector: "unregister",
  993. protocol: 'actions',
  994. fn: function (){
  995. var self=this;
  996. return smalltalk.withContext(function($ctx1) {
  997. ($ctx1.supercall = true, globals.HLSUnit.superclass.fn.prototype._unregister.apply(_st(self), []));
  998. $ctx1.supercall = false;
  999. $ctx1.sendIdx["unregister"]=1;
  1000. _st([self._packagesListWidget(),self._classesListWidget(),self._resultWidget(),self._errorsWidget(),self._failuresWidget()])._do_((function(each){
  1001. return smalltalk.withContext(function($ctx2) {
  1002. return _st(each)._unregister();
  1003. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1004. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnit)})},
  1005. args: [],
  1006. source: "unregister\x0a\x09super unregister.\x0a\x0a\x09{ \x0a\x09\x09self packagesListWidget.\x0a\x09\x09self classesListWidget.\x0a\x09\x09self resultWidget.\x0a\x09\x09self errorsWidget.\x0a\x09\x09self failuresWidget\x0a\x09} \x0a\x09\x09do: [ :each | each unregister ]",
  1007. messageSends: ["unregister", "do:", "packagesListWidget", "classesListWidget", "resultWidget", "errorsWidget", "failuresWidget"],
  1008. referencedClasses: []
  1009. }),
  1010. globals.HLSUnit);
  1011. smalltalk.addMethod(
  1012. smalltalk.method({
  1013. selector: "canBeOpenAsTab",
  1014. protocol: 'testing',
  1015. fn: function (){
  1016. var self=this;
  1017. return true;
  1018. },
  1019. args: [],
  1020. source: "canBeOpenAsTab\x0a\x09^ true",
  1021. messageSends: [],
  1022. referencedClasses: []
  1023. }),
  1024. globals.HLSUnit.klass);
  1025. smalltalk.addMethod(
  1026. smalltalk.method({
  1027. selector: "tabClass",
  1028. protocol: 'accessing',
  1029. fn: function (){
  1030. var self=this;
  1031. return "sunit";
  1032. },
  1033. args: [],
  1034. source: "tabClass\x0a\x09^ 'sunit'",
  1035. messageSends: [],
  1036. referencedClasses: []
  1037. }),
  1038. globals.HLSUnit.klass);
  1039. smalltalk.addMethod(
  1040. smalltalk.method({
  1041. selector: "tabLabel",
  1042. protocol: 'accessing',
  1043. fn: function (){
  1044. var self=this;
  1045. return "SUnit";
  1046. },
  1047. args: [],
  1048. source: "tabLabel\x0a\x09^ 'SUnit'",
  1049. messageSends: [],
  1050. referencedClasses: []
  1051. }),
  1052. globals.HLSUnit.klass);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "tabPriority",
  1056. protocol: 'accessing',
  1057. fn: function (){
  1058. var self=this;
  1059. return (1000);
  1060. },
  1061. args: [],
  1062. source: "tabPriority\x0a\x09^ 1000",
  1063. messageSends: [],
  1064. referencedClasses: []
  1065. }),
  1066. globals.HLSUnit.klass);
  1067. smalltalk.addClass('HLSUnitModel', globals.HLModel, ['selectedPackages', 'selectedClasses', 'testResult', 'currentSuite'], 'Helios-SUnit');
  1068. globals.HLSUnitModel.comment="I am the model for running unit tests in Helios.\x0a\x0aI provide the ability to select set of tests to run per package, and a detailed result log with passed tests, failed tests and errors.";
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "currentSuite",
  1072. protocol: 'accessing',
  1073. fn: function (){
  1074. var self=this;
  1075. var $1;
  1076. $1=self["@currentSuite"];
  1077. return $1;
  1078. },
  1079. args: [],
  1080. source: "currentSuite\x0a\x09^currentSuite",
  1081. messageSends: [],
  1082. referencedClasses: []
  1083. }),
  1084. globals.HLSUnitModel);
  1085. smalltalk.addMethod(
  1086. smalltalk.method({
  1087. selector: "invertSelectedClasses",
  1088. protocol: 'actions',
  1089. fn: function (){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) {
  1092. var $1;
  1093. _st(self._testClasses())._do_((function(each){
  1094. return smalltalk.withContext(function($ctx2) {
  1095. $1=_st(self._unfilteredSelectedClasses())._includes_(each);
  1096. if(smalltalk.assert($1)){
  1097. return self._unselectClass_(each);
  1098. } else {
  1099. return self._selectClass_(each);
  1100. };
  1101. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1102. return self}, function($ctx1) {$ctx1.fill(self,"invertSelectedClasses",{},globals.HLSUnitModel)})},
  1103. args: [],
  1104. source: "invertSelectedClasses\x0a\x09self testClasses do: [:each | \x0a\x09\x09(self unfilteredSelectedClasses includes: each)\x0a\x09\x09\x09ifTrue: [ self unselectClass: each ]\x0a\x09\x09\x09ifFalse: [ self selectClass: each ]].\x0a\x09",
  1105. messageSends: ["do:", "testClasses", "ifTrue:ifFalse:", "includes:", "unfilteredSelectedClasses", "unselectClass:", "selectClass:"],
  1106. referencedClasses: []
  1107. }),
  1108. globals.HLSUnitModel);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "invertSelectedPackages",
  1112. protocol: 'actions',
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) {
  1116. var $1;
  1117. _st(self._testPackages())._do_((function(each){
  1118. return smalltalk.withContext(function($ctx2) {
  1119. $1=_st(self._selectedPackages())._includes_(each);
  1120. if(smalltalk.assert($1)){
  1121. return self._unselectPackage_(each);
  1122. } else {
  1123. return self._selectPackage_(each);
  1124. };
  1125. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1126. return self}, function($ctx1) {$ctx1.fill(self,"invertSelectedPackages",{},globals.HLSUnitModel)})},
  1127. args: [],
  1128. source: "invertSelectedPackages\x0a\x09self testPackages do: [:each | \x0a\x09\x09(self selectedPackages includes: each)\x0a\x09\x09\x09ifTrue: [ self unselectPackage: each ]\x0a\x09\x09\x09ifFalse: [ self selectPackage: each ]].\x0a\x09",
  1129. messageSends: ["do:", "testPackages", "ifTrue:ifFalse:", "includes:", "selectedPackages", "unselectPackage:", "selectPackage:"],
  1130. referencedClasses: []
  1131. }),
  1132. globals.HLSUnitModel);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "onResultAnnouncement:",
  1136. protocol: 'reacting',
  1137. fn: function (announcement){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. _st(self._announcer())._announce_(announcement);
  1141. return self}, function($ctx1) {$ctx1.fill(self,"onResultAnnouncement:",{announcement:announcement},globals.HLSUnitModel)})},
  1142. args: ["announcement"],
  1143. source: "onResultAnnouncement: announcement\x0a\x09\x22Propogate announcement\x22\x0a\x09self announcer announce: announcement.",
  1144. messageSends: ["announce:", "announcer"],
  1145. referencedClasses: []
  1146. }),
  1147. globals.HLSUnitModel);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "runTests",
  1151. protocol: 'actions',
  1152. fn: function (){
  1153. var self=this;
  1154. var worker;
  1155. function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
  1156. function $HLRunTests(){return globals.HLRunTests||(typeof HLRunTests=="undefined"?nil:HLRunTests)}
  1157. return smalltalk.withContext(function($ctx1) {
  1158. worker=_st($TestSuiteRunner())._on_(self._testCases());
  1159. $ctx1.sendIdx["on:"]=1;
  1160. self["@testResult"]=_st(worker)._result();
  1161. _st(self._announcer())._announce_(_st($HLRunTests())._on_(worker));
  1162. self._subscribeToTestSuite_(worker);
  1163. _st(worker)._run();
  1164. return self}, function($ctx1) {$ctx1.fill(self,"runTests",{worker:worker},globals.HLSUnitModel)})},
  1165. args: [],
  1166. source: "runTests\x0a\x09| worker |\x0a\x09worker := TestSuiteRunner on: self testCases.\x0a\x09testResult := worker result.\x0a\x09self announcer announce: (HLRunTests on: worker).\x0a\x09self subscribeToTestSuite: worker.\x0a\x09worker run",
  1167. messageSends: ["on:", "testCases", "result", "announce:", "announcer", "subscribeToTestSuite:", "run"],
  1168. referencedClasses: ["TestSuiteRunner", "HLRunTests"]
  1169. }),
  1170. globals.HLSUnitModel);
  1171. smalltalk.addMethod(
  1172. smalltalk.method({
  1173. selector: "selectAllClasses",
  1174. protocol: 'actions',
  1175. fn: function (){
  1176. var self=this;
  1177. return smalltalk.withContext(function($ctx1) {
  1178. _st(self._testClasses())._do_((function(each){
  1179. return smalltalk.withContext(function($ctx2) {
  1180. return self._selectClass_(each);
  1181. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1182. return self}, function($ctx1) {$ctx1.fill(self,"selectAllClasses",{},globals.HLSUnitModel)})},
  1183. args: [],
  1184. source: "selectAllClasses\x0a\x09self testClasses do: [:each | self selectClass: each].\x0a\x09",
  1185. messageSends: ["do:", "testClasses", "selectClass:"],
  1186. referencedClasses: []
  1187. }),
  1188. globals.HLSUnitModel);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "selectAllPackages",
  1192. protocol: 'actions',
  1193. fn: function (){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) {
  1196. _st(self._testPackages())._do_((function(each){
  1197. return smalltalk.withContext(function($ctx2) {
  1198. return self._selectPackage_(each);
  1199. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1200. return self}, function($ctx1) {$ctx1.fill(self,"selectAllPackages",{},globals.HLSUnitModel)})},
  1201. args: [],
  1202. source: "selectAllPackages\x0a\x09self testPackages do: [:each | self selectPackage: each].",
  1203. messageSends: ["do:", "testPackages", "selectPackage:"],
  1204. referencedClasses: []
  1205. }),
  1206. globals.HLSUnitModel);
  1207. smalltalk.addMethod(
  1208. smalltalk.method({
  1209. selector: "selectClass:",
  1210. protocol: 'actions',
  1211. fn: function (aClass){
  1212. var self=this;
  1213. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1214. return smalltalk.withContext(function($ctx1) {
  1215. _st(self._unfilteredSelectedClasses())._add_(aClass);
  1216. _st(self._announcer())._announce_(_st($HLClassSelected())._on_(aClass));
  1217. return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass},globals.HLSUnitModel)})},
  1218. args: ["aClass"],
  1219. source: "selectClass: aClass\x0a\x09self unfilteredSelectedClasses add: aClass.\x0a\x09self announcer announce: (HLClassSelected on: aClass).",
  1220. messageSends: ["add:", "unfilteredSelectedClasses", "announce:", "announcer", "on:"],
  1221. referencedClasses: ["HLClassSelected"]
  1222. }),
  1223. globals.HLSUnitModel);
  1224. smalltalk.addMethod(
  1225. smalltalk.method({
  1226. selector: "selectPackage:",
  1227. protocol: 'actions',
  1228. fn: function (aPackage){
  1229. var self=this;
  1230. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1231. return smalltalk.withContext(function($ctx1) {
  1232. _st(self._selectedPackages())._add_(aPackage);
  1233. _st(self._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  1234. return self}, function($ctx1) {$ctx1.fill(self,"selectPackage:",{aPackage:aPackage},globals.HLSUnitModel)})},
  1235. args: ["aPackage"],
  1236. source: "selectPackage: aPackage\x0a\x09self selectedPackages add: aPackage.\x0a\x09self announcer announce: (HLPackageSelected on: aPackage).",
  1237. messageSends: ["add:", "selectedPackages", "announce:", "announcer", "on:"],
  1238. referencedClasses: ["HLPackageSelected"]
  1239. }),
  1240. globals.HLSUnitModel);
  1241. smalltalk.addMethod(
  1242. smalltalk.method({
  1243. selector: "selectedClasses",
  1244. protocol: 'accessing',
  1245. fn: function (){
  1246. var self=this;
  1247. return smalltalk.withContext(function($ctx1) {
  1248. var $1;
  1249. $1=_st(self._unfilteredSelectedClasses())._select_((function(each){
  1250. return smalltalk.withContext(function($ctx2) {
  1251. return _st(self._selectedPackages())._includes_(_st(each)._package());
  1252. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1253. return $1;
  1254. }, function($ctx1) {$ctx1.fill(self,"selectedClasses",{},globals.HLSUnitModel)})},
  1255. args: [],
  1256. source: "selectedClasses\x0a\x09^ (self unfilteredSelectedClasses) select: [ :each |\x0a\x09\x09self selectedPackages includes: each package ]",
  1257. messageSends: ["select:", "unfilteredSelectedClasses", "includes:", "selectedPackages", "package"],
  1258. referencedClasses: []
  1259. }),
  1260. globals.HLSUnitModel);
  1261. smalltalk.addMethod(
  1262. smalltalk.method({
  1263. selector: "selectedPackages",
  1264. protocol: 'accessing',
  1265. fn: function (){
  1266. var self=this;
  1267. function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
  1268. return smalltalk.withContext(function($ctx1) {
  1269. var $2,$1;
  1270. $2=self["@selectedPackages"];
  1271. if(($receiver = $2) == nil || $receiver == null){
  1272. self["@selectedPackages"]=_st($Set())._new();
  1273. $1=self["@selectedPackages"];
  1274. } else {
  1275. $1=$2;
  1276. };
  1277. return $1;
  1278. }, function($ctx1) {$ctx1.fill(self,"selectedPackages",{},globals.HLSUnitModel)})},
  1279. args: [],
  1280. source: "selectedPackages\x0a\x09^ selectedPackages ifNil: [ selectedPackages := Set new ]",
  1281. messageSends: ["ifNil:", "new"],
  1282. referencedClasses: ["Set"]
  1283. }),
  1284. globals.HLSUnitModel);
  1285. smalltalk.addMethod(
  1286. smalltalk.method({
  1287. selector: "subscribeToTestSuite:",
  1288. protocol: 'actions',
  1289. fn: function (aTestSuiteRunner){
  1290. var self=this;
  1291. function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  1292. return smalltalk.withContext(function($ctx1) {
  1293. var $1,$2,$receiver;
  1294. $1=self["@currentSuite"];
  1295. if(($receiver = $1) == null || $receiver.isNil){
  1296. $1;
  1297. } else {
  1298. $2=_st(self["@currentSuite"])._announcer();
  1299. $ctx1.sendIdx["announcer"]=1;
  1300. _st($2)._unsubscribe_(self);
  1301. };
  1302. self["@currentSuite"]=aTestSuiteRunner;
  1303. _st(_st(self["@currentSuite"])._announcer())._on_send_to_($ResultAnnouncement(),"onResultAnnouncement:",self);
  1304. return self}, function($ctx1) {$ctx1.fill(self,"subscribeToTestSuite:",{aTestSuiteRunner:aTestSuiteRunner},globals.HLSUnitModel)})},
  1305. args: ["aTestSuiteRunner"],
  1306. source: "subscribeToTestSuite: aTestSuiteRunner\x0a\x09currentSuite ifNotNil: [ currentSuite announcer unsubscribe: self].\x0a\x09currentSuite := aTestSuiteRunner.\x0a\x09currentSuite announcer \x0a\x09\x09on: ResultAnnouncement\x0a\x09\x09send: #onResultAnnouncement:\x0a\x09\x09to: self",
  1307. messageSends: ["ifNotNil:", "unsubscribe:", "announcer", "on:send:to:"],
  1308. referencedClasses: ["ResultAnnouncement"]
  1309. }),
  1310. globals.HLSUnitModel);
  1311. smalltalk.addMethod(
  1312. smalltalk.method({
  1313. selector: "testCases",
  1314. protocol: 'accessing',
  1315. fn: function (){
  1316. var self=this;
  1317. var testCases;
  1318. return smalltalk.withContext(function($ctx1) {
  1319. var $1;
  1320. testCases=[];
  1321. _st(self._selectedClasses())._do_((function(each){
  1322. return smalltalk.withContext(function($ctx2) {
  1323. return _st(testCases)._addAll_(_st(each)._buildSuite());
  1324. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1325. $1=testCases;
  1326. return $1;
  1327. }, function($ctx1) {$ctx1.fill(self,"testCases",{testCases:testCases},globals.HLSUnitModel)})},
  1328. args: [],
  1329. source: "testCases\x0a\x09| testCases |\x0a\x09testCases := #().\x0a\x09self selectedClasses\x0a\x09\x09do: [ :each | testCases addAll: each buildSuite ].\x0a\x09^ testCases",
  1330. messageSends: ["do:", "selectedClasses", "addAll:", "buildSuite"],
  1331. referencedClasses: []
  1332. }),
  1333. globals.HLSUnitModel);
  1334. smalltalk.addMethod(
  1335. smalltalk.method({
  1336. selector: "testClasses",
  1337. protocol: 'accessing',
  1338. fn: function (){
  1339. var self=this;
  1340. var stream;
  1341. function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
  1342. return smalltalk.withContext(function($ctx1) {
  1343. var $1;
  1344. stream=_st(_st($Array())._new())._writeStream();
  1345. _st(self._selectedPackages())._do_((function(package_){
  1346. return smalltalk.withContext(function($ctx2) {
  1347. return _st(stream)._nextPutAll_(_st(_st(package_)._classes())._select_((function(each){
  1348. return smalltalk.withContext(function($ctx3) {
  1349. return _st(each)._isTestClass();
  1350. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})})));
  1351. }, function($ctx2) {$ctx2.fillBlock({package_:package_},$ctx1,1)})}));
  1352. $1=_st(stream)._contents();
  1353. return $1;
  1354. }, function($ctx1) {$ctx1.fill(self,"testClasses",{stream:stream},globals.HLSUnitModel)})},
  1355. args: [],
  1356. source: "testClasses\x0a\x09\x22Answer all concrete subclasses of TestCase in selected packages\x22\x0a\x09\x0a\x09| stream |\x0a\x09stream := Array new writeStream.\x0a\x09self selectedPackages do: [ :package |\x0a\x09\x09stream nextPutAll: (package classes select: [ :each |\x0a\x09\x09\x09each isTestClass ] ) ].\x0a\x09^ stream contents\x0a\x09",
  1357. messageSends: ["writeStream", "new", "do:", "selectedPackages", "nextPutAll:", "select:", "classes", "isTestClass", "contents"],
  1358. referencedClasses: ["Array"]
  1359. }),
  1360. globals.HLSUnitModel);
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "testPackages",
  1364. protocol: 'accessing',
  1365. fn: function (){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. var $1;
  1369. $1=_st(_st(self._environment())._packages())._select_((function(each){
  1370. return smalltalk.withContext(function($ctx2) {
  1371. return _st(each)._isTestPackage();
  1372. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1373. return $1;
  1374. }, function($ctx1) {$ctx1.fill(self,"testPackages",{},globals.HLSUnitModel)})},
  1375. args: [],
  1376. source: "testPackages\x0a\x09\x22Answer all packages containing concrete subclasses of TestCase\x22\x0a\x09\x0a\x09^ self environment packages \x0a\x09\x09select: [ :each | each isTestPackage ]",
  1377. messageSends: ["select:", "packages", "environment", "isTestPackage"],
  1378. referencedClasses: []
  1379. }),
  1380. globals.HLSUnitModel);
  1381. smalltalk.addMethod(
  1382. smalltalk.method({
  1383. selector: "testResult",
  1384. protocol: 'accessing',
  1385. fn: function (){
  1386. var self=this;
  1387. function $TestResult(){return globals.TestResult||(typeof TestResult=="undefined"?nil:TestResult)}
  1388. return smalltalk.withContext(function($ctx1) {
  1389. var $2,$1,$receiver;
  1390. $2=self["@testResult"];
  1391. if(($receiver = $2) == null || $receiver.isNil){
  1392. self["@testResult"]=_st($TestResult())._new();
  1393. $1=self["@testResult"];
  1394. } else {
  1395. $1=$2;
  1396. };
  1397. return $1;
  1398. }, function($ctx1) {$ctx1.fill(self,"testResult",{},globals.HLSUnitModel)})},
  1399. args: [],
  1400. source: "testResult\x0a\x09^testResult ifNil: [testResult := TestResult new]",
  1401. messageSends: ["ifNil:", "new"],
  1402. referencedClasses: ["TestResult"]
  1403. }),
  1404. globals.HLSUnitModel);
  1405. smalltalk.addMethod(
  1406. smalltalk.method({
  1407. selector: "unfilteredSelectedClasses",
  1408. protocol: 'private',
  1409. fn: function (){
  1410. var self=this;
  1411. function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
  1412. return smalltalk.withContext(function($ctx1) {
  1413. var $2,$1,$receiver;
  1414. $2=self["@selectedClasses"];
  1415. if(($receiver = $2) == null || $receiver.isNil){
  1416. self["@selectedClasses"]=_st($Set())._new();
  1417. $1=self["@selectedClasses"];
  1418. } else {
  1419. $1=$2;
  1420. };
  1421. return $1;
  1422. }, function($ctx1) {$ctx1.fill(self,"unfilteredSelectedClasses",{},globals.HLSUnitModel)})},
  1423. args: [],
  1424. source: "unfilteredSelectedClasses\x0a\x09^ (selectedClasses ifNil: [ selectedClasses := Set new ])",
  1425. messageSends: ["ifNil:", "new"],
  1426. referencedClasses: ["Set"]
  1427. }),
  1428. globals.HLSUnitModel);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "unselectClass:",
  1432. protocol: 'actions',
  1433. fn: function (aClass){
  1434. var self=this;
  1435. function $HLClassUnselected(){return globals.HLClassUnselected||(typeof HLClassUnselected=="undefined"?nil:HLClassUnselected)}
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $early={};
  1438. try {
  1439. _st(self._unfilteredSelectedClasses())._remove_ifAbsent_(aClass,(function(){
  1440. throw $early=[self];
  1441. }));
  1442. _st(self._announcer())._announce_(_st($HLClassUnselected())._on_(aClass));
  1443. return self}
  1444. catch(e) {if(e===$early)return e[0]; throw e}
  1445. }, function($ctx1) {$ctx1.fill(self,"unselectClass:",{aClass:aClass},globals.HLSUnitModel)})},
  1446. args: ["aClass"],
  1447. source: "unselectClass: aClass\x0a\x09self unfilteredSelectedClasses remove: aClass ifAbsent: [^self].\x0a\x09self announcer announce: (HLClassUnselected on: aClass).",
  1448. messageSends: ["remove:ifAbsent:", "unfilteredSelectedClasses", "announce:", "announcer", "on:"],
  1449. referencedClasses: ["HLClassUnselected"]
  1450. }),
  1451. globals.HLSUnitModel);
  1452. smalltalk.addMethod(
  1453. smalltalk.method({
  1454. selector: "unselectPackage:",
  1455. protocol: 'actions',
  1456. fn: function (aPackage){
  1457. var self=this;
  1458. function $HLPackageUnselected(){return globals.HLPackageUnselected||(typeof HLPackageUnselected=="undefined"?nil:HLPackageUnselected)}
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $early={};
  1461. try {
  1462. _st(self._selectedPackages())._remove_ifAbsent_(aPackage,(function(){
  1463. throw $early=[self];
  1464. }));
  1465. _st(self._announcer())._announce_(_st($HLPackageUnselected())._on_(aPackage));
  1466. return self}
  1467. catch(e) {if(e===$early)return e[0]; throw e}
  1468. }, function($ctx1) {$ctx1.fill(self,"unselectPackage:",{aPackage:aPackage},globals.HLSUnitModel)})},
  1469. args: ["aPackage"],
  1470. source: "unselectPackage: aPackage\x0a\x09self selectedPackages remove: aPackage ifAbsent: [^self].\x0a\x09self announcer announce: (HLPackageUnselected on: aPackage).",
  1471. messageSends: ["remove:ifAbsent:", "selectedPackages", "announce:", "announcer", "on:"],
  1472. referencedClasses: ["HLPackageUnselected"]
  1473. }),
  1474. globals.HLSUnitModel);
  1475. smalltalk.addClass('HLSUnitResultListWidget', globals.HLToolListWidget, [], 'Helios-SUnit');
  1476. globals.HLSUnitResultListWidget.comment="I group the lists that display test results";
  1477. smalltalk.addMethod(
  1478. smalltalk.method({
  1479. selector: "observeModel",
  1480. protocol: 'initialization',
  1481. fn: function (){
  1482. var self=this;
  1483. function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  1484. return smalltalk.withContext(function($ctx1) {
  1485. _st(_st(self._model())._announcer())._on_send_to_($ResultAnnouncement(),"onResultAnnouncement:",self);
  1486. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLSUnitResultListWidget)})},
  1487. args: [],
  1488. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: ResultAnnouncement\x0a\x09\x09send: #onResultAnnouncement:\x0a\x09\x09to: self",
  1489. messageSends: ["on:send:to:", "announcer", "model"],
  1490. referencedClasses: ["ResultAnnouncement"]
  1491. }),
  1492. globals.HLSUnitResultListWidget);
  1493. smalltalk.addMethod(
  1494. smalltalk.method({
  1495. selector: "onResultAnnouncement:",
  1496. protocol: 'reacting',
  1497. fn: function (announcement){
  1498. var self=this;
  1499. return smalltalk.withContext(function($ctx1) {
  1500. self._refresh();
  1501. return self}, function($ctx1) {$ctx1.fill(self,"onResultAnnouncement:",{announcement:announcement},globals.HLSUnitResultListWidget)})},
  1502. args: ["announcement"],
  1503. source: "onResultAnnouncement: announcement\x0a\x09self refresh.",
  1504. messageSends: ["refresh"],
  1505. referencedClasses: []
  1506. }),
  1507. globals.HLSUnitResultListWidget);
  1508. smalltalk.addMethod(
  1509. smalltalk.method({
  1510. selector: "performFailure:",
  1511. protocol: 'actions',
  1512. fn: function (aTestCase){
  1513. var self=this;
  1514. return smalltalk.withContext(function($ctx1) {
  1515. _st(aTestCase)._runCase();
  1516. return self}, function($ctx1) {$ctx1.fill(self,"performFailure:",{aTestCase:aTestCase},globals.HLSUnitResultListWidget)})},
  1517. args: ["aTestCase"],
  1518. source: "performFailure: aTestCase\x0a\x09aTestCase runCase",
  1519. messageSends: ["runCase"],
  1520. referencedClasses: []
  1521. }),
  1522. globals.HLSUnitResultListWidget);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "renderItemLabel:on:",
  1526. protocol: 'rendering',
  1527. fn: function (anObject,html){
  1528. var self=this;
  1529. return smalltalk.withContext(function($ctx1) {
  1530. var $1;
  1531. $1=_st(_st(_st(_st(anObject)._class())._name()).__comma(" >> ")).__comma(_st(anObject)._selector());
  1532. $ctx1.sendIdx[","]=1;
  1533. _st(html)._with_($1);
  1534. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},globals.HLSUnitResultListWidget)})},
  1535. args: ["anObject", "html"],
  1536. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject class name, ' >> ', anObject selector",
  1537. messageSends: ["with:", ",", "name", "class", "selector"],
  1538. referencedClasses: []
  1539. }),
  1540. globals.HLSUnitResultListWidget);
  1541. smalltalk.addMethod(
  1542. smalltalk.method({
  1543. selector: "reselectItem:",
  1544. protocol: 'rendering',
  1545. fn: function (anObject){
  1546. var self=this;
  1547. return smalltalk.withContext(function($ctx1) {
  1548. self._performFailure_(anObject);
  1549. return self}, function($ctx1) {$ctx1.fill(self,"reselectItem:",{anObject:anObject},globals.HLSUnitResultListWidget)})},
  1550. args: ["anObject"],
  1551. source: "reselectItem: anObject\x0a\x09self performFailure: anObject ",
  1552. messageSends: ["performFailure:"],
  1553. referencedClasses: []
  1554. }),
  1555. globals.HLSUnitResultListWidget);
  1556. smalltalk.addClass('HLSUnitErrorsListWidget', globals.HLSUnitResultListWidget, [], 'Helios-SUnit');
  1557. globals.HLSUnitErrorsListWidget.comment="I display a list of tests that have errors";
  1558. smalltalk.addMethod(
  1559. smalltalk.method({
  1560. selector: "items",
  1561. protocol: 'accessing',
  1562. fn: function (){
  1563. var self=this;
  1564. return smalltalk.withContext(function($ctx1) {
  1565. var $1;
  1566. $1=_st(_st(self._model())._testResult())._errors();
  1567. return $1;
  1568. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLSUnitErrorsListWidget)})},
  1569. args: [],
  1570. source: "items\x0a\x09^self model testResult errors",
  1571. messageSends: ["errors", "testResult", "model"],
  1572. referencedClasses: []
  1573. }),
  1574. globals.HLSUnitErrorsListWidget);
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "label",
  1578. protocol: 'accessing',
  1579. fn: function (){
  1580. var self=this;
  1581. return "Errors";
  1582. },
  1583. args: [],
  1584. source: "label\x0a\x09^'Errors'",
  1585. messageSends: [],
  1586. referencedClasses: []
  1587. }),
  1588. globals.HLSUnitErrorsListWidget);
  1589. smalltalk.addClass('HLSUnitFailuresListWidget', globals.HLSUnitResultListWidget, [], 'Helios-SUnit');
  1590. globals.HLSUnitFailuresListWidget.comment="I display a list of tests that have failures";
  1591. smalltalk.addMethod(
  1592. smalltalk.method({
  1593. selector: "items",
  1594. protocol: 'accessing',
  1595. fn: function (){
  1596. var self=this;
  1597. return smalltalk.withContext(function($ctx1) {
  1598. var $1;
  1599. $1=_st(_st(self._model())._testResult())._failures();
  1600. return $1;
  1601. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLSUnitFailuresListWidget)})},
  1602. args: [],
  1603. source: "items\x0a\x09^self model testResult failures",
  1604. messageSends: ["failures", "testResult", "model"],
  1605. referencedClasses: []
  1606. }),
  1607. globals.HLSUnitFailuresListWidget);
  1608. smalltalk.addMethod(
  1609. smalltalk.method({
  1610. selector: "label",
  1611. protocol: 'accessing',
  1612. fn: function (){
  1613. var self=this;
  1614. return "Failures";
  1615. },
  1616. args: [],
  1617. source: "label\x0a\x09^'Failures'",
  1618. messageSends: [],
  1619. referencedClasses: []
  1620. }),
  1621. globals.HLSUnitFailuresListWidget);
  1622. smalltalk.addClass('HLSUnitResultStatus', globals.HLWidget, ['model'], 'Helios-SUnit');
  1623. globals.HLSUnitResultStatus.comment="I display the status of the previous test run\x0a\x0a1. How many tests where run.\x0a* How many tests passed.\x0a* How many tests failed.\x0a* How many tests resulted in an error.\x0a";
  1624. smalltalk.addMethod(
  1625. smalltalk.method({
  1626. selector: "model",
  1627. protocol: 'accessing',
  1628. fn: function (){
  1629. var self=this;
  1630. function $TestResult(){return globals.TestResult||(typeof TestResult=="undefined"?nil:TestResult)}
  1631. return smalltalk.withContext(function($ctx1) {
  1632. var $2,$1,$receiver;
  1633. $2=self["@model"];
  1634. if(($receiver = $2) == null || $receiver.isNil){
  1635. self["@model"]=_st($TestResult())._new();
  1636. $1=self["@model"];
  1637. } else {
  1638. $1=$2;
  1639. };
  1640. return $1;
  1641. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLSUnitResultStatus)})},
  1642. args: [],
  1643. source: "model\x0a\x09^ model ifNil: [model := TestResult new]",
  1644. messageSends: ["ifNil:", "new"],
  1645. referencedClasses: ["TestResult"]
  1646. }),
  1647. globals.HLSUnitResultStatus);
  1648. smalltalk.addMethod(
  1649. smalltalk.method({
  1650. selector: "model:",
  1651. protocol: 'accessing',
  1652. fn: function (anObject){
  1653. var self=this;
  1654. return smalltalk.withContext(function($ctx1) {
  1655. self["@model"]=anObject;
  1656. self._observeModel();
  1657. return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},globals.HLSUnitResultStatus)})},
  1658. args: ["anObject"],
  1659. source: "model: anObject\x0a\x09model := anObject.\x0a\x09self observeModel.",
  1660. messageSends: ["observeModel"],
  1661. referencedClasses: []
  1662. }),
  1663. globals.HLSUnitResultStatus);
  1664. smalltalk.addMethod(
  1665. smalltalk.method({
  1666. selector: "observeModel",
  1667. protocol: 'actions',
  1668. fn: function (){
  1669. var self=this;
  1670. function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  1671. return smalltalk.withContext(function($ctx1) {
  1672. _st(_st(self._model())._announcer())._on_send_to_($ResultAnnouncement(),"onResultAnnouncement:",self);
  1673. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLSUnitResultStatus)})},
  1674. args: [],
  1675. source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: ResultAnnouncement\x0a\x09\x09send: #onResultAnnouncement:\x0a\x09\x09to: self",
  1676. messageSends: ["on:send:to:", "announcer", "model"],
  1677. referencedClasses: ["ResultAnnouncement"]
  1678. }),
  1679. globals.HLSUnitResultStatus);
  1680. smalltalk.addMethod(
  1681. smalltalk.method({
  1682. selector: "onResultAnnouncement:",
  1683. protocol: 'reacting',
  1684. fn: function (announcement){
  1685. var self=this;
  1686. return smalltalk.withContext(function($ctx1) {
  1687. self._refresh();
  1688. return self}, function($ctx1) {$ctx1.fill(self,"onResultAnnouncement:",{announcement:announcement},globals.HLSUnitResultStatus)})},
  1689. args: ["announcement"],
  1690. source: "onResultAnnouncement: announcement\x0a\x09self refresh.",
  1691. messageSends: ["refresh"],
  1692. referencedClasses: []
  1693. }),
  1694. globals.HLSUnitResultStatus);
  1695. smalltalk.addMethod(
  1696. smalltalk.method({
  1697. selector: "printErrors",
  1698. protocol: 'printing',
  1699. fn: function (){
  1700. var self=this;
  1701. return smalltalk.withContext(function($ctx1) {
  1702. var $1;
  1703. $1=_st(_st(_st(_st(self._result())._errors())._size())._asString()).__comma(" errors, ");
  1704. return $1;
  1705. }, function($ctx1) {$ctx1.fill(self,"printErrors",{},globals.HLSUnitResultStatus)})},
  1706. args: [],
  1707. source: "printErrors\x0a\x09^ self result errors size asString , ' errors, '",
  1708. messageSends: [",", "asString", "size", "errors", "result"],
  1709. referencedClasses: []
  1710. }),
  1711. globals.HLSUnitResultStatus);
  1712. smalltalk.addMethod(
  1713. smalltalk.method({
  1714. selector: "printFailures",
  1715. protocol: 'printing',
  1716. fn: function (){
  1717. var self=this;
  1718. return smalltalk.withContext(function($ctx1) {
  1719. var $1;
  1720. $1=_st(_st(_st(_st(self._result())._failures())._size())._asString()).__comma(" failures");
  1721. return $1;
  1722. }, function($ctx1) {$ctx1.fill(self,"printFailures",{},globals.HLSUnitResultStatus)})},
  1723. args: [],
  1724. source: "printFailures\x0a\x09^ self result failures size asString, ' failures'",
  1725. messageSends: [",", "asString", "size", "failures", "result"],
  1726. referencedClasses: []
  1727. }),
  1728. globals.HLSUnitResultStatus);
  1729. smalltalk.addMethod(
  1730. smalltalk.method({
  1731. selector: "printPasses",
  1732. protocol: 'printing',
  1733. fn: function (){
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx1) {
  1736. var $6,$5,$9,$8,$7,$4,$3,$2,$1;
  1737. $6=self._result();
  1738. $ctx1.sendIdx["result"]=1;
  1739. $5=_st($6)._runs();
  1740. $9=self._result();
  1741. $ctx1.sendIdx["result"]=2;
  1742. $8=_st($9)._errors();
  1743. $7=_st($8)._size();
  1744. $ctx1.sendIdx["size"]=1;
  1745. $4=_st($5).__minus($7);
  1746. $3=_st($4).__minus(_st(_st(self._result())._failures())._size());
  1747. $ctx1.sendIdx["-"]=1;
  1748. $2=_st($3)._asString();
  1749. $1=_st($2).__comma(" passes, ");
  1750. return $1;
  1751. }, function($ctx1) {$ctx1.fill(self,"printPasses",{},globals.HLSUnitResultStatus)})},
  1752. args: [],
  1753. source: "printPasses\x0a\x09^ (self result runs - self result errors size - self result failures size) asString , ' passes, '",
  1754. messageSends: [",", "asString", "-", "runs", "result", "size", "errors", "failures"],
  1755. referencedClasses: []
  1756. }),
  1757. globals.HLSUnitResultStatus);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "printTotal",
  1761. protocol: 'printing',
  1762. fn: function (){
  1763. var self=this;
  1764. return smalltalk.withContext(function($ctx1) {
  1765. var $1;
  1766. $1=_st(_st(_st(self._result())._total())._asString()).__comma(" runs, ");
  1767. return $1;
  1768. }, function($ctx1) {$ctx1.fill(self,"printTotal",{},globals.HLSUnitResultStatus)})},
  1769. args: [],
  1770. source: "printTotal\x0a\x09^ self result total asString, ' runs, '",
  1771. messageSends: [",", "asString", "total", "result"],
  1772. referencedClasses: []
  1773. }),
  1774. globals.HLSUnitResultStatus);
  1775. smalltalk.addMethod(
  1776. smalltalk.method({
  1777. selector: "renderContentOn:",
  1778. protocol: 'rendering',
  1779. fn: function (html){
  1780. var self=this;
  1781. return smalltalk.withContext(function($ctx1) {
  1782. var $1,$2;
  1783. $1=_st(html)._div();
  1784. _st($1)._class_(self._statusCssClass());
  1785. $2=_st($1)._with_((function(){
  1786. return smalltalk.withContext(function($ctx2) {
  1787. return _st(_st(html)._span())._with_(self._statusInfo());
  1788. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1789. $ctx1.sendIdx["with:"]=1;
  1790. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLSUnitResultStatus)})},
  1791. args: ["html"],
  1792. source: "renderContentOn: html\x0a\x09html div\x0a\x09\x09class: self statusCssClass;\x0a\x09\x09with: [ html span with: self statusInfo ]",
  1793. messageSends: ["class:", "div", "statusCssClass", "with:", "span", "statusInfo"],
  1794. referencedClasses: []
  1795. }),
  1796. globals.HLSUnitResultStatus);
  1797. smalltalk.addMethod(
  1798. smalltalk.method({
  1799. selector: "result",
  1800. protocol: 'accessing',
  1801. fn: function (){
  1802. var self=this;
  1803. return smalltalk.withContext(function($ctx1) {
  1804. var $1;
  1805. $1=_st(self._model())._testResult();
  1806. return $1;
  1807. }, function($ctx1) {$ctx1.fill(self,"result",{},globals.HLSUnitResultStatus)})},
  1808. args: [],
  1809. source: "result\x0a\x09^ self model testResult",
  1810. messageSends: ["testResult", "model"],
  1811. referencedClasses: []
  1812. }),
  1813. globals.HLSUnitResultStatus);
  1814. smalltalk.addMethod(
  1815. smalltalk.method({
  1816. selector: "statusCssClass",
  1817. protocol: 'accessing',
  1818. fn: function (){
  1819. var self=this;
  1820. return smalltalk.withContext(function($ctx1) {
  1821. var $1;
  1822. $1="sunit status ".__comma(_st(self._result())._status());
  1823. return $1;
  1824. }, function($ctx1) {$ctx1.fill(self,"statusCssClass",{},globals.HLSUnitResultStatus)})},
  1825. args: [],
  1826. source: "statusCssClass\x0a\x09^'sunit status ', self result status",
  1827. messageSends: [",", "status", "result"],
  1828. referencedClasses: []
  1829. }),
  1830. globals.HLSUnitResultStatus);
  1831. smalltalk.addMethod(
  1832. smalltalk.method({
  1833. selector: "statusInfo",
  1834. protocol: 'accessing',
  1835. fn: function (){
  1836. var self=this;
  1837. return smalltalk.withContext(function($ctx1) {
  1838. var $2,$1;
  1839. $2=_st(_st(self._printTotal()).__comma(self._printPasses())).__comma(self._printErrors());
  1840. $ctx1.sendIdx[","]=2;
  1841. $1=_st($2).__comma(self._printFailures());
  1842. $ctx1.sendIdx[","]=1;
  1843. return $1;
  1844. }, function($ctx1) {$ctx1.fill(self,"statusInfo",{},globals.HLSUnitResultStatus)})},
  1845. args: [],
  1846. source: "statusInfo\x0a\x09^ self printTotal, self printPasses, self printErrors, self printFailures",
  1847. messageSends: [",", "printTotal", "printPasses", "printErrors", "printFailures"],
  1848. referencedClasses: []
  1849. }),
  1850. globals.HLSUnitResultStatus);
  1851. smalltalk.addMethod(
  1852. smalltalk.method({
  1853. selector: "unregister",
  1854. protocol: 'actions',
  1855. fn: function (){
  1856. var self=this;
  1857. return smalltalk.withContext(function($ctx1) {
  1858. ($ctx1.supercall = true, globals.HLSUnitResultStatus.superclass.fn.prototype._unregister.apply(_st(self), []));
  1859. $ctx1.supercall = false;
  1860. _st(_st(self._model())._announcer())._unsubscribe_(self);
  1861. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnitResultStatus)})},
  1862. args: [],
  1863. source: "unregister\x0a\x09super unregister.\x0a\x09self model announcer unsubscribe: self.",
  1864. messageSends: ["unregister", "unsubscribe:", "announcer", "model"],
  1865. referencedClasses: []
  1866. }),
  1867. globals.HLSUnitResultStatus);
  1868. smalltalk.addClass('HLSUnitResults', globals.HLWidget, ['model', 'progressBarWidget', 'resultStatusWidget'], 'Helios-SUnit');
  1869. globals.HLSUnitResults.comment="I am the widget that displays the test results for a previous test run in Helios.\x0a\x0aI display.\x0a\x0a1. The status of the tests.\x0a* Progress of the currently running test suite.";
  1870. smalltalk.addMethod(
  1871. smalltalk.method({
  1872. selector: "model",
  1873. protocol: 'accessing',
  1874. fn: function (){
  1875. var self=this;
  1876. var $1;
  1877. $1=self["@model"];
  1878. return $1;
  1879. },
  1880. args: [],
  1881. source: "model\x0a\x09^model",
  1882. messageSends: [],
  1883. referencedClasses: []
  1884. }),
  1885. globals.HLSUnitResults);
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "model:",
  1889. protocol: 'accessing',
  1890. fn: function (anObject){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) {
  1893. self["@model"]=anObject;
  1894. self._observeModel();
  1895. return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},globals.HLSUnitResults)})},
  1896. args: ["anObject"],
  1897. source: "model: anObject\x0a\x09model := anObject.\x0a\x09self observeModel",
  1898. messageSends: ["observeModel"],
  1899. referencedClasses: []
  1900. }),
  1901. globals.HLSUnitResults);
  1902. smalltalk.addMethod(
  1903. smalltalk.method({
  1904. selector: "observeModel",
  1905. protocol: 'initialization',
  1906. fn: function (){
  1907. var self=this;
  1908. function $HLRunTests(){return globals.HLRunTests||(typeof HLRunTests=="undefined"?nil:HLRunTests)}
  1909. function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  1910. return smalltalk.withContext(function($ctx1) {
  1911. var $1,$2;
  1912. $1=_st(self._model())._announcer();
  1913. _st($1)._on_send_to_($HLRunTests(),"onRunTests:",self);
  1914. $ctx1.sendIdx["on:send:to:"]=1;
  1915. $2=_st($1)._on_send_to_($ResultAnnouncement(),"onResultAnnouncement:",self);
  1916. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLSUnitResults)})},
  1917. args: [],
  1918. source: "observeModel\x0a self model announcer \x0a\x09\x09on: HLRunTests\x0a\x09\x09send: #onRunTests:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: ResultAnnouncement\x0a\x09\x09send: #onResultAnnouncement:\x0a\x09\x09to: self",
  1919. messageSends: ["on:send:to:", "announcer", "model"],
  1920. referencedClasses: ["HLRunTests", "ResultAnnouncement"]
  1921. }),
  1922. globals.HLSUnitResults);
  1923. smalltalk.addMethod(
  1924. smalltalk.method({
  1925. selector: "onResultAnnouncement:",
  1926. protocol: 'reacting',
  1927. fn: function (announcement){
  1928. var self=this;
  1929. return smalltalk.withContext(function($ctx1) {
  1930. var $1,$7,$6,$5,$4,$3,$2;
  1931. _st((function(){
  1932. return smalltalk.withContext(function($ctx2) {
  1933. $1=self._progressBarWidget();
  1934. $7=self._model();
  1935. $ctx2.sendIdx["model"]=1;
  1936. $6=_st($7)._testResult();
  1937. $ctx2.sendIdx["testResult"]=1;
  1938. $5=_st($6)._runs();
  1939. $4=_st($5).__slash(_st(_st(self._model())._testResult())._total());
  1940. $3=_st($4).__star((100));
  1941. $2=_st($3)._rounded();
  1942. return _st($1)._updateProgress_($2);
  1943. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((10));
  1944. return self}, function($ctx1) {$ctx1.fill(self,"onResultAnnouncement:",{announcement:announcement},globals.HLSUnitResults)})},
  1945. args: ["announcement"],
  1946. source: "onResultAnnouncement: announcement\x0a\x09[self progressBarWidget \x0a\x09\x09updateProgress: (self model testResult runs / self model testResult total * 100) rounded] valueWithTimeout: 10 ",
  1947. messageSends: ["valueWithTimeout:", "updateProgress:", "progressBarWidget", "rounded", "*", "/", "runs", "testResult", "model", "total"],
  1948. referencedClasses: []
  1949. }),
  1950. globals.HLSUnitResults);
  1951. smalltalk.addMethod(
  1952. smalltalk.method({
  1953. selector: "onRunTests:",
  1954. protocol: 'reacting',
  1955. fn: function (announcement){
  1956. var self=this;
  1957. return smalltalk.withContext(function($ctx1) {
  1958. var $1,$2;
  1959. $1=self._progressBarWidget();
  1960. _st($1)._updateProgress_((0));
  1961. $2=_st($1)._refresh();
  1962. return self}, function($ctx1) {$ctx1.fill(self,"onRunTests:",{announcement:announcement},globals.HLSUnitResults)})},
  1963. args: ["announcement"],
  1964. source: "onRunTests: announcement\x0a\x09self progressBarWidget updateProgress: 0;\x0a\x09\x09refresh.",
  1965. messageSends: ["updateProgress:", "progressBarWidget", "refresh"],
  1966. referencedClasses: []
  1967. }),
  1968. globals.HLSUnitResults);
  1969. smalltalk.addMethod(
  1970. smalltalk.method({
  1971. selector: "progressBarWidget",
  1972. protocol: 'accessing',
  1973. fn: function (){
  1974. var self=this;
  1975. function $HLProgressBarWidget(){return globals.HLProgressBarWidget||(typeof HLProgressBarWidget=="undefined"?nil:HLProgressBarWidget)}
  1976. return smalltalk.withContext(function($ctx1) {
  1977. var $2,$3,$4,$1,$receiver;
  1978. $2=self["@progressBarWidget"];
  1979. if(($receiver = $2) == null || $receiver.isNil){
  1980. $3=_st($HLProgressBarWidget())._new();
  1981. _st($3)._label_("");
  1982. $4=_st($3)._yourself();
  1983. self["@progressBarWidget"]=$4;
  1984. $1=self["@progressBarWidget"];
  1985. } else {
  1986. $1=$2;
  1987. };
  1988. return $1;
  1989. }, function($ctx1) {$ctx1.fill(self,"progressBarWidget",{},globals.HLSUnitResults)})},
  1990. args: [],
  1991. source: "progressBarWidget\x0a\x09^progressBarWidget ifNil: [progressBarWidget := HLProgressBarWidget new\x0a\x09\x09label: '';\x0a\x09\x09yourself]",
  1992. messageSends: ["ifNil:", "label:", "new", "yourself"],
  1993. referencedClasses: ["HLProgressBarWidget"]
  1994. }),
  1995. globals.HLSUnitResults);
  1996. smalltalk.addMethod(
  1997. smalltalk.method({
  1998. selector: "renderContentOn:",
  1999. protocol: 'rendering',
  2000. fn: function (html){
  2001. var self=this;
  2002. return smalltalk.withContext(function($ctx1) {
  2003. var $1;
  2004. _st(html)._with_(self._resultStatusWidget());
  2005. $ctx1.sendIdx["with:"]=1;
  2006. $1=_st(html)._with_(self._progressBarWidget());
  2007. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLSUnitResults)})},
  2008. args: ["html"],
  2009. source: "renderContentOn: html\x0a\x09html with: self resultStatusWidget;\x0a\x09\x09with: self progressBarWidget",
  2010. messageSends: ["with:", "resultStatusWidget", "progressBarWidget"],
  2011. referencedClasses: []
  2012. }),
  2013. globals.HLSUnitResults);
  2014. smalltalk.addMethod(
  2015. smalltalk.method({
  2016. selector: "resultStatusWidget",
  2017. protocol: 'accessing',
  2018. fn: function (){
  2019. var self=this;
  2020. function $HLSUnitResultStatus(){return globals.HLSUnitResultStatus||(typeof HLSUnitResultStatus=="undefined"?nil:HLSUnitResultStatus)}
  2021. return smalltalk.withContext(function($ctx1) {
  2022. var $2,$3,$4,$1,$receiver;
  2023. $2=self["@resultStatusWidget"];
  2024. if(($receiver = $2) == null || $receiver.isNil){
  2025. $3=_st($HLSUnitResultStatus())._new();
  2026. _st($3)._model_(self._model());
  2027. $4=_st($3)._yourself();
  2028. self["@resultStatusWidget"]=$4;
  2029. $1=self["@resultStatusWidget"];
  2030. } else {
  2031. $1=$2;
  2032. };
  2033. return $1;
  2034. }, function($ctx1) {$ctx1.fill(self,"resultStatusWidget",{},globals.HLSUnitResults)})},
  2035. args: [],
  2036. source: "resultStatusWidget\x0a\x09^resultStatusWidget ifNil: [resultStatusWidget := HLSUnitResultStatus new\x0a\x09\x09model: self model;\x0a\x09\x09yourself]",
  2037. messageSends: ["ifNil:", "model:", "new", "model", "yourself"],
  2038. referencedClasses: ["HLSUnitResultStatus"]
  2039. }),
  2040. globals.HLSUnitResults);
  2041. smalltalk.addMethod(
  2042. smalltalk.method({
  2043. selector: "unregister",
  2044. protocol: 'actions',
  2045. fn: function (){
  2046. var self=this;
  2047. return smalltalk.withContext(function($ctx1) {
  2048. ($ctx1.supercall = true, globals.HLSUnitResults.superclass.fn.prototype._unregister.apply(_st(self), []));
  2049. $ctx1.supercall = false;
  2050. $ctx1.sendIdx["unregister"]=1;
  2051. _st(_st(self._model())._announcer())._unsubscribe_(self);
  2052. _st(self._resultStatusWidget())._unregister();
  2053. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnitResults)})},
  2054. args: [],
  2055. source: "unregister\x0a\x09super unregister.\x0a\x09self model announcer unsubscribe: self.\x0a\x09self resultStatusWidget unregister.",
  2056. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "resultStatusWidget"],
  2057. referencedClasses: []
  2058. }),
  2059. globals.HLSUnitResults);
  2060. });