1
0

SUnit.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. smalltalk.addClass('TestCase', smalltalk.Object, ['testedClass'], 'SUnit');
  2. smalltalk.addMethod(
  3. '_testedClass',
  4. smalltalk.method({
  5. selector: 'testedClass',
  6. fn: function (){
  7. var self=this;
  8. return self['@testedClass'];
  9. return self;}
  10. }),
  11. smalltalk.TestCase);
  12. smalltalk.addMethod(
  13. '_testedClass_',
  14. smalltalk.method({
  15. selector: 'testedClass:',
  16. fn: function (aClass){
  17. var self=this;
  18. self['@testedClass']=aClass;
  19. return self;}
  20. }),
  21. smalltalk.TestCase);
  22. smalltalk.addMethod(
  23. '_cleanUpInstanceVariables',
  24. smalltalk.method({
  25. selector: 'cleanUpInstanceVariables',
  26. fn: function (){
  27. var self=this;
  28. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_instanceVariableNames", []), "_do_", [(function(name){return smalltalk.send(smalltalk.send(name, "__eq", ["testSelector"]), "_ifFalse_", [(function(){return smalltalk.send(self, "_instVarAt_put_", [name, nil]);})]);})]);
  29. return self;}
  30. }),
  31. smalltalk.TestCase);
  32. smalltalk.addMethod(
  33. '_signalFailure_',
  34. smalltalk.method({
  35. selector: 'signalFailure:',
  36. fn: function (aString){
  37. var self=this;
  38. (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(smalltalk.TestFailure, "_new", []));
  39. return self;}
  40. }),
  41. smalltalk.TestCase);
  42. smalltalk.addMethod(
  43. '_setUp',
  44. smalltalk.method({
  45. selector: 'setUp',
  46. fn: function (){
  47. var self=this;
  48. return self;}
  49. }),
  50. smalltalk.TestCase);
  51. smalltalk.addMethod(
  52. '_tearDown',
  53. smalltalk.method({
  54. selector: 'tearDown',
  55. fn: function (){
  56. var self=this;
  57. return self;}
  58. }),
  59. smalltalk.TestCase);
  60. smalltalk.addMethod(
  61. '_methods',
  62. smalltalk.method({
  63. selector: 'methods',
  64. fn: function (){
  65. var self=this;
  66. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", [unescape("%5Etest")]);})]);
  67. return self;}
  68. }),
  69. smalltalk.TestCase);
  70. smalltalk.addMethod(
  71. '_runCaseFor_',
  72. smalltalk.method({
  73. selector: 'runCaseFor:',
  74. fn: function (aTestResult){
  75. var self=this;
  76. smalltalk.send((function(){smalltalk.send(self, "_setUp", []);return smalltalk.send(self, "_performTestFor_", [aTestResult]);}), "_on_do_", [smalltalk.Error, (function(ex){smalltalk.send(self, "_tearDown", []);smalltalk.send(self, "_cleanUpInstanceVariables", []);return smalltalk.send(ex, "_signal", []);})]);
  77. smalltalk.send(self, "_tearDown", []);
  78. smalltalk.send(self, "_cleanUpInstanceVariables", []);
  79. return self;}
  80. }),
  81. smalltalk.TestCase);
  82. smalltalk.addMethod(
  83. '_performTestFor_',
  84. smalltalk.method({
  85. selector: 'performTestFor:',
  86. fn: function (aResult){
  87. var self=this;
  88. smalltalk.send(smalltalk.send(self, "_methods", []), "_do_", [(function(each){smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [each]);}), "_on_do_", [smalltalk.TestFailure, (function(ex){return smalltalk.send(aResult, "_addFailure_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_name", []), "__comma", [unescape("%3E%3E")]), "__comma", [each])]);})]);}), "_on_do_", [smalltalk.Error, (function(ex){return smalltalk.send(aResult, "_addError_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_name", []), "__comma", [unescape("%3E%3E")]), "__comma", [each])]);})]);return smalltalk.send(aResult, "_increaseRuns", []);})]);
  89. return self;}
  90. }),
  91. smalltalk.TestCase);
  92. smalltalk.addMethod(
  93. '_assert_',
  94. smalltalk.method({
  95. selector: 'assert:',
  96. fn: function (aBoolean){
  97. var self=this;
  98. smalltalk.send(aBoolean, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", ["Assertion failed"]);})]);
  99. return self;}
  100. }),
  101. smalltalk.TestCase);
  102. smalltalk.addMethod(
  103. '_deny_',
  104. smalltalk.method({
  105. selector: 'deny:',
  106. fn: function (aBoolean){
  107. var self=this;
  108. smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
  109. return self;}
  110. }),
  111. smalltalk.TestCase);
  112. smalltalk.addMethod(
  113. '_assert_equals_',
  114. smalltalk.method({
  115. selector: 'assert:equals:',
  116. fn: function (expected, actual){
  117. var self=this;
  118. return smalltalk.send(self, "_assert_", [smalltalk.send(expected, "__eq", [actual])]);
  119. return self;}
  120. }),
  121. smalltalk.TestCase);
  122. smalltalk.addClass('ProgressBar', smalltalk.TabWidget, ['percent', 'progressDiv', 'div'], 'SUnit');
  123. smalltalk.addMethod(
  124. '_percent',
  125. smalltalk.method({
  126. selector: 'percent',
  127. fn: function (){
  128. var self=this;
  129. return smalltalk.send(self['@percent'], "_ifNil_", [(function(){return (0);})]);
  130. return self;}
  131. }),
  132. smalltalk.ProgressBar);
  133. smalltalk.addMethod(
  134. '_percent_',
  135. smalltalk.method({
  136. selector: 'percent:',
  137. fn: function (aNumber){
  138. var self=this;
  139. self['@percent']=aNumber;
  140. return self;}
  141. }),
  142. smalltalk.ProgressBar);
  143. smalltalk.addMethod(
  144. '_renderOn_',
  145. smalltalk.method({
  146. selector: 'renderOn:',
  147. fn: function (html){
  148. var self=this;
  149. self['@div']=(function($rec){smalltalk.send($rec, "_class_", ["progress_bar"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(html, "_div", []));
  150. smalltalk.send(self, "_renderProgressBar", []);
  151. return self;}
  152. }),
  153. smalltalk.ProgressBar);
  154. smalltalk.addMethod(
  155. '_updatePercent_',
  156. smalltalk.method({
  157. selector: 'updatePercent:',
  158. fn: function (aNumber){
  159. var self=this;
  160. smalltalk.send(self, "_percent_", [aNumber]);
  161. smalltalk.send(self, "_renderProgressBar", []);
  162. return self;}
  163. }),
  164. smalltalk.ProgressBar);
  165. smalltalk.addMethod(
  166. '_renderProgressBar',
  167. smalltalk.method({
  168. selector: 'renderProgressBar',
  169. fn: function (){
  170. var self=this;
  171. smalltalk.send(self['@div'], "_contents_", [(function(html){return (function($rec){smalltalk.send($rec, "_class_", ["progress"]);return smalltalk.send($rec, "_style_", [smalltalk.send(smalltalk.send("width:", "__comma", [smalltalk.send(smalltalk.send(self, "_percent", []), "_asString", [])]), "__comma", [unescape("%25")])]);})(smalltalk.send(html, "_div", []));})]);
  172. return self;}
  173. }),
  174. smalltalk.ProgressBar);
  175. smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
  176. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'categoriesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'SUnit');
  177. smalltalk.addMethod(
  178. '_label',
  179. smalltalk.method({
  180. selector: 'label',
  181. fn: function (){
  182. var self=this;
  183. return unescape("%5BTest%20runner%5D");
  184. return self;}
  185. }),
  186. smalltalk.TestRunner);
  187. smalltalk.addMethod(
  188. '_categories',
  189. smalltalk.method({
  190. selector: 'categories',
  191. fn: function (){
  192. var self=this;
  193. var categories=nil;
  194. categories=smalltalk.send(smalltalk.Array, "_new", []);
  195. smalltalk.send(smalltalk.send(self, "_allClasses", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(categories, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(categories, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  196. return smalltalk.send(categories, "_sort", []);
  197. return self;}
  198. }),
  199. smalltalk.TestRunner);
  200. smalltalk.addMethod(
  201. '_classes',
  202. smalltalk.method({
  203. selector: 'classes',
  204. fn: function (){
  205. var self=this;
  206. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_allClasses", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [smalltalk.send(each, "_category", [])]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_name", []), "__gt", [smalltalk.send(b, "_name", [])]);})]);
  207. return self;}
  208. }),
  209. smalltalk.TestRunner);
  210. smalltalk.addMethod(
  211. '_selectedCategories',
  212. smalltalk.method({
  213. selector: 'selectedCategories',
  214. fn: function (){
  215. var self=this;
  216. return smalltalk.send(self['@selectedCategories'], "_ifNil_", [(function(){return self['@selectedCategories']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  217. return self;}
  218. }),
  219. smalltalk.TestRunner);
  220. smalltalk.addMethod(
  221. '_allClasses',
  222. smalltalk.method({
  223. selector: 'allClasses',
  224. fn: function (){
  225. var self=this;
  226. return smalltalk.send(smalltalk.TestCase, "_allSubclasses", []);
  227. return self;}
  228. }),
  229. smalltalk.TestRunner);
  230. smalltalk.addMethod(
  231. '_selectedClasses',
  232. smalltalk.method({
  233. selector: 'selectedClasses',
  234. fn: function (){
  235. var self=this;
  236. return smalltalk.send(self['@selectedClasses'], "_ifNil_", [(function(){return self['@selectedClasses']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  237. return self;}
  238. }),
  239. smalltalk.TestRunner);
  240. smalltalk.addMethod(
  241. '_progressBar',
  242. smalltalk.method({
  243. selector: 'progressBar',
  244. fn: function (){
  245. var self=this;
  246. return smalltalk.send(self['@progressBar'], "_ifNil_", [(function(){return self['@progressBar']=smalltalk.send(smalltalk.ProgressBar, "_new", []);})]);
  247. return self;}
  248. }),
  249. smalltalk.TestRunner);
  250. smalltalk.addMethod(
  251. '_selectedMethods',
  252. smalltalk.method({
  253. selector: 'selectedMethods',
  254. fn: function (){
  255. var self=this;
  256. return smalltalk.send(self['@selectedMethods'], "_ifNil_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_methodDictionary", []), "_keys", []), "_select_", [(function(key){return smalltalk.send(key, "_beginsWith_", ["test"]);})]);})]);})]);
  257. return self;}
  258. }),
  259. smalltalk.TestRunner);
  260. smalltalk.addMethod(
  261. '_statusInfo',
  262. smalltalk.method({
  263. selector: 'statusInfo',
  264. fn: function (){
  265. var self=this;
  266. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printTotal", []), "__comma", [smalltalk.send(self, "_printPasses", [])]), "__comma", [smalltalk.send(self, "_printErrors", [])]), "__comma", [smalltalk.send(self, "_printFailures", [])]);
  267. return self;}
  268. }),
  269. smalltalk.TestRunner);
  270. smalltalk.addMethod(
  271. '_result',
  272. smalltalk.method({
  273. selector: 'result',
  274. fn: function (){
  275. var self=this;
  276. return self['@result'];
  277. return self;}
  278. }),
  279. smalltalk.TestRunner);
  280. smalltalk.addMethod(
  281. '_failedMethods',
  282. smalltalk.method({
  283. selector: 'failedMethods',
  284. fn: function (){
  285. var self=this;
  286. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_collect_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["failures"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  287. return self;}
  288. }),
  289. smalltalk.TestRunner);
  290. smalltalk.addMethod(
  291. '_selectAllCategories',
  292. smalltalk.method({
  293. selector: 'selectAllCategories',
  294. fn: function (){
  295. var self=this;
  296. smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self['@selectedCategories'], "_includes_", [each]), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_add_", [each]);})]);})]);
  297. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  298. return self;}
  299. }),
  300. smalltalk.TestRunner);
  301. smalltalk.addMethod(
  302. '_toggleCategory_',
  303. smalltalk.method({
  304. selector: 'toggleCategory:',
  305. fn: function (aCategory){
  306. var self=this;
  307. smalltalk.send(smalltalk.send(self, "_isSelectedCategory_", [aCategory]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@selectedCategories'], "_add_", [aCategory]);}), (function(){return smalltalk.send(self['@selectedCategories'], "_remove_", [aCategory]);})]);
  308. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  309. return self;}
  310. }),
  311. smalltalk.TestRunner);
  312. smalltalk.addMethod(
  313. '_toggleClass_',
  314. smalltalk.method({
  315. selector: 'toggleClass:',
  316. fn: function (aClass){
  317. var self=this;
  318. smalltalk.send(smalltalk.send(self, "_isSelectedClass_", [aClass]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@selectedClasses'], "_add_", [aClass]);}), (function(){return smalltalk.send(self['@selectedClasses'], "_remove_", [aClass]);})]);
  319. smalltalk.send(self, "_updateClassesList", []);
  320. return self;}
  321. }),
  322. smalltalk.TestRunner);
  323. smalltalk.addMethod(
  324. '_selectAllClasses',
  325. smalltalk.method({
  326. selector: 'selectAllClasses',
  327. fn: function (){
  328. var self=this;
  329. smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self['@selectedClasses'], "_includes_", [each]), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_add_", [each]);})]);})]);
  330. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  331. return self;}
  332. }),
  333. smalltalk.TestRunner);
  334. smalltalk.addMethod(
  335. '_run_',
  336. smalltalk.method({
  337. selector: 'run:',
  338. fn: function (aCollection){
  339. var self=this;
  340. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  341. (function($rec){smalltalk.send($rec, "_updateStatusDiv", []);return smalltalk.send($rec, "_updateMethodsList", []);})(self);
  342. smalltalk.send(smalltalk.send(self, "_progressBar", []), "_updatePercent_", [(0)]);
  343. smalltalk.send(self['@result'], "_total_", [smalltalk.send(aCollection, "_inject_into_", [(0), (function(acc, each){return smalltalk.send(acc, "__plus", [smalltalk.send(smalltalk.send(each, "_methods", []), "_size", [])]);})])]);
  344. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send((function(){smalltalk.send(each, "_runCaseFor_", [self['@result']]);smalltalk.send(smalltalk.send(self, "_progressBar", []), "_updatePercent_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@result'], "_runs", []), "__slash", [smalltalk.send(self['@result'], "_total", [])]), "__star", [(100)])]);smalltalk.send(self, "_updateStatusDiv", []);return smalltalk.send(self, "_updateMethodsList", []);}), "_valueWithTimeout_", [(100)]);})]);
  345. return self;}
  346. }),
  347. smalltalk.TestRunner);
  348. smalltalk.addMethod(
  349. '_initialize',
  350. smalltalk.method({
  351. selector: 'initialize',
  352. fn: function (){
  353. var self=this;
  354. smalltalk.send(self, "_initialize", [], smalltalk.TabWidget);
  355. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  356. return self;}
  357. }),
  358. smalltalk.TestRunner);
  359. smalltalk.addMethod(
  360. '_printErrors',
  361. smalltalk.method({
  362. selector: 'printErrors',
  363. fn: function (){
  364. var self=this;
  365. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_size", []), "_asString", []), "__comma", [unescape("%20errors%2C%20")]);
  366. return self;}
  367. }),
  368. smalltalk.TestRunner);
  369. smalltalk.addMethod(
  370. '_printFailures',
  371. smalltalk.method({
  372. selector: 'printFailures',
  373. fn: function (){
  374. var self=this;
  375. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_size", []), "_asString", []), "__comma", [" failures"]);
  376. return self;}
  377. }),
  378. smalltalk.TestRunner);
  379. smalltalk.addMethod(
  380. '_printPasses',
  381. smalltalk.method({
  382. selector: 'printPasses',
  383. fn: function (){
  384. var self=this;
  385. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_total", []), "__minus", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_size", []), "__plus", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_size", [])])]), "_asString", []), "__comma", [unescape("%20passes%2C%20")]);
  386. return self;}
  387. }),
  388. smalltalk.TestRunner);
  389. smalltalk.addMethod(
  390. '_printTotal',
  391. smalltalk.method({
  392. selector: 'printTotal',
  393. fn: function (){
  394. var self=this;
  395. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_total", []), "_asString", []), "__comma", [unescape("%20runs%2C%20")]);
  396. return self;}
  397. }),
  398. smalltalk.TestRunner);
  399. smalltalk.addMethod(
  400. '_renderBoxOn_',
  401. smalltalk.method({
  402. selector: 'renderBoxOn:',
  403. fn: function (html){
  404. var self=this;
  405. (function($rec){smalltalk.send($rec, "_renderCategoriesOn_", [html]);smalltalk.send($rec, "_renderClassesOn_", [html]);return smalltalk.send($rec, "_renderResultsOn_", [html]);})(self);
  406. return self;}
  407. }),
  408. smalltalk.TestRunner);
  409. smalltalk.addMethod(
  410. '_renderButtonsOn_',
  411. smalltalk.method({
  412. selector: 'renderButtonsOn:',
  413. fn: function (html){
  414. var self=this;
  415. (function($rec){smalltalk.send($rec, "_with_", ["Run selected"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_run_", [smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_collect_", [(function(each){return smalltalk.send(each, "_new", []);})])]);})]);})(smalltalk.send(html, "_button", []));
  416. return self;}
  417. }),
  418. smalltalk.TestRunner);
  419. smalltalk.addMethod(
  420. '_renderCategoriesOn_',
  421. smalltalk.method({
  422. selector: 'renderCategoriesOn:',
  423. fn: function (html){
  424. var self=this;
  425. self['@categoriesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit categories"]);
  426. smalltalk.send(self, "_updateCategoriesList", []);
  427. return self;}
  428. }),
  429. smalltalk.TestRunner);
  430. smalltalk.addMethod(
  431. '_renderClassesOn_',
  432. smalltalk.method({
  433. selector: 'renderClassesOn:',
  434. fn: function (html){
  435. var self=this;
  436. self['@classesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit classes"]);
  437. smalltalk.send(self, "_updateClassesList", []);
  438. return self;}
  439. }),
  440. smalltalk.TestRunner);
  441. smalltalk.addMethod(
  442. '_renderResultsOn_',
  443. smalltalk.method({
  444. selector: 'renderResultsOn:',
  445. fn: function (html){
  446. var self=this;
  447. self['@statusDiv']=smalltalk.send(html, "_div", []);
  448. smalltalk.send(html, "_with_", [smalltalk.send(self, "_progressBar", [])]);
  449. self['@methodsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit methods"]);
  450. smalltalk.send(self, "_updateMethodsList", []);
  451. smalltalk.send(self, "_updateStatusDiv", []);
  452. return self;}
  453. }),
  454. smalltalk.TestRunner);
  455. smalltalk.addMethod(
  456. '_renderFailuresOn_',
  457. smalltalk.method({
  458. selector: 'renderFailuresOn:',
  459. fn: function (html){
  460. var self=this;
  461. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["failures"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  462. return self;}
  463. }),
  464. smalltalk.TestRunner);
  465. smalltalk.addMethod(
  466. '_renderErrorsOn_',
  467. smalltalk.method({
  468. selector: 'renderErrorsOn:',
  469. fn: function (html){
  470. var self=this;
  471. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["errors"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  472. return self;}
  473. }),
  474. smalltalk.TestRunner);
  475. smalltalk.addMethod(
  476. '_canBeClosed',
  477. smalltalk.method({
  478. selector: 'canBeClosed',
  479. fn: function (){
  480. var self=this;
  481. return true;
  482. return self;}
  483. }),
  484. smalltalk.TestRunner);
  485. smalltalk.addMethod(
  486. '_isSelectedClass_',
  487. smalltalk.method({
  488. selector: 'isSelectedClass:',
  489. fn: function (aClass){
  490. var self=this;
  491. return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_includes_", [aClass]);
  492. return self;}
  493. }),
  494. smalltalk.TestRunner);
  495. smalltalk.addMethod(
  496. '_isSelectedCategory_',
  497. smalltalk.method({
  498. selector: 'isSelectedCategory:',
  499. fn: function (aCategory){
  500. var self=this;
  501. return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [aCategory]);
  502. return self;}
  503. }),
  504. smalltalk.TestRunner);
  505. smalltalk.addMethod(
  506. '_updateCategoriesList',
  507. smalltalk.method({
  508. selector: 'updateCategoriesList',
  509. fn: function (){
  510. var self=this;
  511. smalltalk.send(self['@categoriesList'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_class_", ["all"]);smalltalk.send($rec, "_with_", ["All"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectAllCategories", []);})]);})(smalltalk.send(html, "_li", []));return smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){var li=nil;
  512. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_toggleCategory_", [each]);})]);})(li);})]);})]);
  513. return self;}
  514. }),
  515. smalltalk.TestRunner);
  516. smalltalk.addMethod(
  517. '_updateClassesList',
  518. smalltalk.method({
  519. selector: 'updateClassesList',
  520. fn: function (){
  521. var self=this;
  522. smalltalk.send(self['@classesList'], "_contents_", [(function(html){smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_isEmpty", []), "_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_class_", ["all"]);smalltalk.send($rec, "_with_", ["All"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectAllClasses", []);})]);})(smalltalk.send(html, "_li", []));})]);return smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){var li=nil;
  523. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_includes_", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_toggleClass_", [each]);})]);})(li);})]);})]);
  524. return self;}
  525. }),
  526. smalltalk.TestRunner);
  527. smalltalk.addMethod(
  528. '_updateMethodsList',
  529. smalltalk.method({
  530. selector: 'updateMethodsList',
  531. fn: function (){
  532. var self=this;
  533. smalltalk.send(self['@methodsList'], "_contents_", [(function(html){smalltalk.send(self, "_renderFailuresOn_", [html]);return smalltalk.send(self, "_renderErrorsOn_", [html]);})]);
  534. return self;}
  535. }),
  536. smalltalk.TestRunner);
  537. smalltalk.addMethod(
  538. '_updateStatusDiv',
  539. smalltalk.method({
  540. selector: 'updateStatusDiv',
  541. fn: function (){
  542. var self=this;
  543. smalltalk.send(self['@statusDiv'], "_class_", [smalltalk.send("sunit status ", "__comma", [smalltalk.send(self['@result'], "_status", [])])]);
  544. smalltalk.send(self['@statusDiv'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(html, "_span", []), "_with_", [smalltalk.send(self, "_statusInfo", [])]);})]);
  545. return self;}
  546. }),
  547. smalltalk.TestRunner);
  548. smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
  549. smalltalk.addMethod(
  550. '_timestamp',
  551. smalltalk.method({
  552. selector: 'timestamp',
  553. fn: function (){
  554. var self=this;
  555. return self['@timestamp'];
  556. return self;}
  557. }),
  558. smalltalk.TestResult);
  559. smalltalk.addMethod(
  560. '_errors',
  561. smalltalk.method({
  562. selector: 'errors',
  563. fn: function (){
  564. var self=this;
  565. return self['@errors'];
  566. return self;}
  567. }),
  568. smalltalk.TestResult);
  569. smalltalk.addMethod(
  570. '_failures',
  571. smalltalk.method({
  572. selector: 'failures',
  573. fn: function (){
  574. var self=this;
  575. return self['@failures'];
  576. return self;}
  577. }),
  578. smalltalk.TestResult);
  579. smalltalk.addMethod(
  580. '_total',
  581. smalltalk.method({
  582. selector: 'total',
  583. fn: function (){
  584. var self=this;
  585. return self['@total'];
  586. return self;}
  587. }),
  588. smalltalk.TestResult);
  589. smalltalk.addMethod(
  590. '_total_',
  591. smalltalk.method({
  592. selector: 'total:',
  593. fn: function (aNumber){
  594. var self=this;
  595. self['@total']=aNumber;
  596. return self;}
  597. }),
  598. smalltalk.TestResult);
  599. smalltalk.addMethod(
  600. '_addError_',
  601. smalltalk.method({
  602. selector: 'addError:',
  603. fn: function (anError){
  604. var self=this;
  605. smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
  606. return self;}
  607. }),
  608. smalltalk.TestResult);
  609. smalltalk.addMethod(
  610. '_addFailure_',
  611. smalltalk.method({
  612. selector: 'addFailure:',
  613. fn: function (aFailure){
  614. var self=this;
  615. smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
  616. return self;}
  617. }),
  618. smalltalk.TestResult);
  619. smalltalk.addMethod(
  620. '_runs',
  621. smalltalk.method({
  622. selector: 'runs',
  623. fn: function (){
  624. var self=this;
  625. return self['@runs'];
  626. return self;}
  627. }),
  628. smalltalk.TestResult);
  629. smalltalk.addMethod(
  630. '_increaseRuns',
  631. smalltalk.method({
  632. selector: 'increaseRuns',
  633. fn: function (){
  634. var self=this;
  635. self['@runs']=smalltalk.send(self['@runs'], "__plus", [(1)]);
  636. return self;}
  637. }),
  638. smalltalk.TestResult);
  639. smalltalk.addMethod(
  640. '_status',
  641. smalltalk.method({
  642. selector: 'status',
  643. fn: function (){
  644. var self=this;
  645. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);}), (function(){return "error";})]);
  646. return self;}
  647. }),
  648. smalltalk.TestResult);
  649. smalltalk.addMethod(
  650. '_initialize',
  651. smalltalk.method({
  652. selector: 'initialize',
  653. fn: function (){
  654. var self=this;
  655. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  656. self['@timestamp']=smalltalk.send(smalltalk.Date, "_now", []);
  657. self['@runs']=(0);
  658. self['@errors']=smalltalk.send(smalltalk.Array, "_new", []);
  659. self['@failures']=smalltalk.send(smalltalk.Array, "_new", []);
  660. self['@total']=(0);
  661. return self;}
  662. }),
  663. smalltalk.TestResult);