1
0

Helios-Commands-SUnit.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. define("helios/Helios-Commands-SUnit", ["amber/boot", "helios/Helios-Commands-Tools"], function($boot){
  2. var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
  3. smalltalk.addPackage('Helios-Commands-SUnit');
  4. smalltalk.packages["Helios-Commands-SUnit"].transport = {"type":"amd","amdNamespace":"helios"};
  5. smalltalk.addClass('HLSUnitCommand', globals.HLToolCommand, [], 'Helios-Commands-SUnit');
  6. globals.HLSUnitCommand.comment="I group the commands pertaining to Helios-SUnit (`HLSUnitModel`)";
  7. smalltalk.addMethod(
  8. smalltalk.method({
  9. selector: "isValidFor:",
  10. protocol: 'testing',
  11. fn: function (aModel){
  12. var self=this;
  13. function $HLSUnitModel(){return globals.HLSUnitModel||(typeof HLSUnitModel=="undefined"?nil:HLSUnitModel)}
  14. return smalltalk.withContext(function($ctx1) {
  15. var $1;
  16. $1=_st(aModel)._isKindOf_($HLSUnitModel());
  17. return $1;
  18. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLSUnitCommand.klass)})},
  19. args: ["aModel"],
  20. source: "isValidFor: aModel\x0a\x09^ aModel isKindOf: HLSUnitModel",
  21. messageSends: ["isKindOf:"],
  22. referencedClasses: ["HLSUnitModel"]
  23. }),
  24. globals.HLSUnitCommand.klass);
  25. smalltalk.addClass('HLSUnitInvertSelectedCommand', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  26. globals.HLSUnitInvertSelectedCommand.comment="I group the commands that invert selections";
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "key",
  30. protocol: 'accessing',
  31. fn: function (){
  32. var self=this;
  33. return "i";
  34. },
  35. args: [],
  36. source: "key\x0a\x09^ 'i'",
  37. messageSends: [],
  38. referencedClasses: []
  39. }),
  40. globals.HLSUnitInvertSelectedCommand.klass);
  41. smalltalk.addMethod(
  42. smalltalk.method({
  43. selector: "label",
  44. protocol: 'accessing',
  45. fn: function (){
  46. var self=this;
  47. return "Invert selection";
  48. },
  49. args: [],
  50. source: "label\x0a\x09^'Invert selection'",
  51. messageSends: [],
  52. referencedClasses: []
  53. }),
  54. globals.HLSUnitInvertSelectedCommand.klass);
  55. smalltalk.addClass('HLSUnitInvertSelectedClassesCommand', globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  56. globals.HLSUnitInvertSelectedClassesCommand.comment="Invert the currently selected classes on a `HLSUnitModel`";
  57. smalltalk.addMethod(
  58. smalltalk.method({
  59. selector: "category",
  60. protocol: 'accessing',
  61. fn: function (){
  62. var self=this;
  63. return "Classes";
  64. },
  65. args: [],
  66. source: "category\x0a\x09^'Classes'",
  67. messageSends: [],
  68. referencedClasses: []
  69. }),
  70. globals.HLSUnitInvertSelectedClassesCommand);
  71. smalltalk.addMethod(
  72. smalltalk.method({
  73. selector: "execute",
  74. protocol: 'executing',
  75. fn: function (){
  76. var self=this;
  77. return smalltalk.withContext(function($ctx1) {
  78. _st(self._model())._invertSelectedClasses();
  79. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitInvertSelectedClassesCommand)})},
  80. args: [],
  81. source: "execute\x0a\x09self model invertSelectedClasses",
  82. messageSends: ["invertSelectedClasses", "model"],
  83. referencedClasses: []
  84. }),
  85. globals.HLSUnitInvertSelectedClassesCommand);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "isActive",
  89. protocol: 'testing',
  90. fn: function (){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. var $1;
  94. $1=_st(_st(self["@model"])._selectedPackages())._notEmpty();
  95. return $1;
  96. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLSUnitInvertSelectedClassesCommand)})},
  97. args: [],
  98. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  99. messageSends: ["notEmpty", "selectedPackages"],
  100. referencedClasses: []
  101. }),
  102. globals.HLSUnitInvertSelectedClassesCommand);
  103. smalltalk.addMethod(
  104. smalltalk.method({
  105. selector: "key",
  106. protocol: 'accessing',
  107. fn: function (){
  108. var self=this;
  109. return "c";
  110. },
  111. args: [],
  112. source: "key\x0a\x09^ 'c'",
  113. messageSends: [],
  114. referencedClasses: []
  115. }),
  116. globals.HLSUnitInvertSelectedClassesCommand.klass);
  117. smalltalk.addMethod(
  118. smalltalk.method({
  119. selector: "label",
  120. protocol: 'accessing',
  121. fn: function (){
  122. var self=this;
  123. return "Invert selected classes";
  124. },
  125. args: [],
  126. source: "label\x0a\x09^ 'Invert selected classes'",
  127. messageSends: [],
  128. referencedClasses: []
  129. }),
  130. globals.HLSUnitInvertSelectedClassesCommand.klass);
  131. smalltalk.addClass('HLSUnitInvertSelectedPackagesCommand', globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  132. globals.HLSUnitInvertSelectedPackagesCommand.comment="Invert the currently selected packages on a `HLSUnitModel`";
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "category",
  136. protocol: 'accessing',
  137. fn: function (){
  138. var self=this;
  139. return "Packages";
  140. },
  141. args: [],
  142. source: "category\x0a\x09^'Packages'",
  143. messageSends: [],
  144. referencedClasses: []
  145. }),
  146. globals.HLSUnitInvertSelectedPackagesCommand);
  147. smalltalk.addMethod(
  148. smalltalk.method({
  149. selector: "execute",
  150. protocol: 'executing',
  151. fn: function (){
  152. var self=this;
  153. return smalltalk.withContext(function($ctx1) {
  154. _st(self._model())._invertSelectedPackages();
  155. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitInvertSelectedPackagesCommand)})},
  156. args: [],
  157. source: "execute\x0a\x09self model invertSelectedPackages",
  158. messageSends: ["invertSelectedPackages", "model"],
  159. referencedClasses: []
  160. }),
  161. globals.HLSUnitInvertSelectedPackagesCommand);
  162. smalltalk.addMethod(
  163. smalltalk.method({
  164. selector: "isActive",
  165. protocol: 'testing',
  166. fn: function (){
  167. var self=this;
  168. return true;
  169. },
  170. args: [],
  171. source: "isActive\x0a\x09^true",
  172. messageSends: [],
  173. referencedClasses: []
  174. }),
  175. globals.HLSUnitInvertSelectedPackagesCommand);
  176. smalltalk.addMethod(
  177. smalltalk.method({
  178. selector: "key",
  179. protocol: 'accessing',
  180. fn: function (){
  181. var self=this;
  182. return "p";
  183. },
  184. args: [],
  185. source: "key\x0a\x09^ 'p'",
  186. messageSends: [],
  187. referencedClasses: []
  188. }),
  189. globals.HLSUnitInvertSelectedPackagesCommand.klass);
  190. smalltalk.addMethod(
  191. smalltalk.method({
  192. selector: "label",
  193. protocol: 'accessing',
  194. fn: function (){
  195. var self=this;
  196. return "Invert selected packages";
  197. },
  198. args: [],
  199. source: "label\x0a\x09^ 'Invert selected packages'",
  200. messageSends: [],
  201. referencedClasses: []
  202. }),
  203. globals.HLSUnitInvertSelectedPackagesCommand.klass);
  204. smalltalk.addClass('HLSUnitRunTests', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  205. globals.HLSUnitRunTests.comment="Run the test cases in the currently selected classes on a `HLSUnitModel`";
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "execute",
  209. protocol: 'executing',
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(self._model())._runTests();
  214. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitRunTests)})},
  215. args: [],
  216. source: "execute\x0a\x09self model runTests",
  217. messageSends: ["runTests", "model"],
  218. referencedClasses: []
  219. }),
  220. globals.HLSUnitRunTests);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "isActive",
  224. protocol: 'testing',
  225. fn: function (){
  226. var self=this;
  227. return true;
  228. },
  229. args: [],
  230. source: "isActive\x0a\x09^true",
  231. messageSends: [],
  232. referencedClasses: []
  233. }),
  234. globals.HLSUnitRunTests);
  235. smalltalk.addMethod(
  236. smalltalk.method({
  237. selector: "key",
  238. protocol: 'accessing',
  239. fn: function (){
  240. var self=this;
  241. return "r";
  242. },
  243. args: [],
  244. source: "key\x0a\x09^'r'",
  245. messageSends: [],
  246. referencedClasses: []
  247. }),
  248. globals.HLSUnitRunTests.klass);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "label",
  252. protocol: 'accessing',
  253. fn: function (){
  254. var self=this;
  255. return "Run Tests";
  256. },
  257. args: [],
  258. source: "label\x0a\x09^'Run Tests'",
  259. messageSends: [],
  260. referencedClasses: []
  261. }),
  262. globals.HLSUnitRunTests.klass);
  263. smalltalk.addClass('HLSUnitSelectAllCommand', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  264. globals.HLSUnitSelectAllCommand.comment="I group the select all commands";
  265. smalltalk.addMethod(
  266. smalltalk.method({
  267. selector: "key",
  268. protocol: 'accessing',
  269. fn: function (){
  270. var self=this;
  271. return "a";
  272. },
  273. args: [],
  274. source: "key\x0a\x09^ 'a'",
  275. messageSends: [],
  276. referencedClasses: []
  277. }),
  278. globals.HLSUnitSelectAllCommand.klass);
  279. smalltalk.addMethod(
  280. smalltalk.method({
  281. selector: "label",
  282. protocol: 'accessing',
  283. fn: function (){
  284. var self=this;
  285. return "Select all";
  286. },
  287. args: [],
  288. source: "label\x0a\x09^ 'Select all'",
  289. messageSends: [],
  290. referencedClasses: []
  291. }),
  292. globals.HLSUnitSelectAllCommand.klass);
  293. smalltalk.addClass('HLSUnitSelectAllClassesCommand', globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  294. globals.HLSUnitSelectAllClassesCommand.comment="Select all available test classes based on what packages are selected on a `HLSUnitModel`";
  295. smalltalk.addMethod(
  296. smalltalk.method({
  297. selector: "category",
  298. protocol: 'accessing',
  299. fn: function (){
  300. var self=this;
  301. return "Classes";
  302. },
  303. args: [],
  304. source: "category\x0a\x09^'Classes'",
  305. messageSends: [],
  306. referencedClasses: []
  307. }),
  308. globals.HLSUnitSelectAllClassesCommand);
  309. smalltalk.addMethod(
  310. smalltalk.method({
  311. selector: "execute",
  312. protocol: 'executing',
  313. fn: function (){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) {
  316. _st(self._model())._selectAllClasses();
  317. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitSelectAllClassesCommand)})},
  318. args: [],
  319. source: "execute\x0a\x09self model selectAllClasses",
  320. messageSends: ["selectAllClasses", "model"],
  321. referencedClasses: []
  322. }),
  323. globals.HLSUnitSelectAllClassesCommand);
  324. smalltalk.addMethod(
  325. smalltalk.method({
  326. selector: "isActive",
  327. protocol: 'testing',
  328. fn: function (){
  329. var self=this;
  330. return smalltalk.withContext(function($ctx1) {
  331. var $1;
  332. $1=_st(_st(self["@model"])._selectedPackages())._notEmpty();
  333. return $1;
  334. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLSUnitSelectAllClassesCommand)})},
  335. args: [],
  336. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  337. messageSends: ["notEmpty", "selectedPackages"],
  338. referencedClasses: []
  339. }),
  340. globals.HLSUnitSelectAllClassesCommand);
  341. smalltalk.addMethod(
  342. smalltalk.method({
  343. selector: "key",
  344. protocol: 'accessing',
  345. fn: function (){
  346. var self=this;
  347. return "c";
  348. },
  349. args: [],
  350. source: "key\x0a\x09^ 'c'",
  351. messageSends: [],
  352. referencedClasses: []
  353. }),
  354. globals.HLSUnitSelectAllClassesCommand.klass);
  355. smalltalk.addMethod(
  356. smalltalk.method({
  357. selector: "label",
  358. protocol: 'accessing',
  359. fn: function (){
  360. var self=this;
  361. return "Select all classes";
  362. },
  363. args: [],
  364. source: "label\x0a\x09^ 'Select all classes'",
  365. messageSends: [],
  366. referencedClasses: []
  367. }),
  368. globals.HLSUnitSelectAllClassesCommand.klass);
  369. smalltalk.addClass('HLSUnitSelectAllPackagesCommand', globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  370. globals.HLSUnitSelectAllPackagesCommand.comment="Select all packages with test cases on a `HLSUnitModel`";
  371. smalltalk.addMethod(
  372. smalltalk.method({
  373. selector: "category",
  374. protocol: 'accessing',
  375. fn: function (){
  376. var self=this;
  377. return "Packages";
  378. },
  379. args: [],
  380. source: "category\x0a\x09^'Packages'",
  381. messageSends: [],
  382. referencedClasses: []
  383. }),
  384. globals.HLSUnitSelectAllPackagesCommand);
  385. smalltalk.addMethod(
  386. smalltalk.method({
  387. selector: "execute",
  388. protocol: 'executing',
  389. fn: function (){
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) {
  392. _st(self._model())._selectAllPackages();
  393. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitSelectAllPackagesCommand)})},
  394. args: [],
  395. source: "execute\x0a\x09self model selectAllPackages",
  396. messageSends: ["selectAllPackages", "model"],
  397. referencedClasses: []
  398. }),
  399. globals.HLSUnitSelectAllPackagesCommand);
  400. smalltalk.addMethod(
  401. smalltalk.method({
  402. selector: "isActive",
  403. protocol: 'testing',
  404. fn: function (){
  405. var self=this;
  406. return true;
  407. },
  408. args: [],
  409. source: "isActive\x0a\x09^true",
  410. messageSends: [],
  411. referencedClasses: []
  412. }),
  413. globals.HLSUnitSelectAllPackagesCommand);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "key",
  417. protocol: 'accessing',
  418. fn: function (){
  419. var self=this;
  420. return "p";
  421. },
  422. args: [],
  423. source: "key\x0a\x09^ 'p'",
  424. messageSends: [],
  425. referencedClasses: []
  426. }),
  427. globals.HLSUnitSelectAllPackagesCommand.klass);
  428. smalltalk.addMethod(
  429. smalltalk.method({
  430. selector: "label",
  431. protocol: 'accessing',
  432. fn: function (){
  433. var self=this;
  434. return "Select all packages";
  435. },
  436. args: [],
  437. source: "label\x0a\x09^ 'Select all packages'",
  438. messageSends: [],
  439. referencedClasses: []
  440. }),
  441. globals.HLSUnitSelectAllPackagesCommand.klass);
  442. });