Helios-Commands-SUnit.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. define(["amber/boot", "helios/Helios-Commands-Tools"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  4. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  5. $core.addPackage('Helios-Commands-SUnit');
  6. $core.packages["Helios-Commands-SUnit"].innerEval = function (expr) { return eval(expr); };
  7. $core.packages["Helios-Commands-SUnit"].transport = {"type":"amd","amdNamespace":"helios"};
  8. $core.addClass('HLSUnitCommand', $globals.HLToolCommand, [], 'Helios-Commands-SUnit');
  9. //>>excludeStart("ide", pragmas.excludeIdeData);
  10. $globals.HLSUnitCommand.comment="I group the commands pertaining to Helios-SUnit (`HLSUnitModel`)";
  11. //>>excludeEnd("ide");
  12. $core.addMethod(
  13. $core.method({
  14. selector: "isValidFor:",
  15. protocol: 'testing',
  16. fn: function (aModel){
  17. var self=this;
  18. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  19. return $core.withContext(function($ctx1) {
  20. //>>excludeEnd("ctx");
  21. return $recv(aModel)._isKindOf_($globals.HLSUnitModel);
  22. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  23. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},$globals.HLSUnitCommand.klass)});
  24. //>>excludeEnd("ctx");
  25. },
  26. //>>excludeStart("ide", pragmas.excludeIdeData);
  27. args: ["aModel"],
  28. source: "isValidFor: aModel\x0a\x09^ aModel isKindOf: HLSUnitModel",
  29. referencedClasses: ["HLSUnitModel"],
  30. //>>excludeEnd("ide");
  31. messageSends: ["isKindOf:"]
  32. }),
  33. $globals.HLSUnitCommand.klass);
  34. $core.addClass('HLSUnitInvertSelectedCommand', $globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  35. //>>excludeStart("ide", pragmas.excludeIdeData);
  36. $globals.HLSUnitInvertSelectedCommand.comment="I group the commands that invert selections";
  37. //>>excludeEnd("ide");
  38. $core.addMethod(
  39. $core.method({
  40. selector: "key",
  41. protocol: 'accessing',
  42. fn: function (){
  43. var self=this;
  44. return "i";
  45. },
  46. //>>excludeStart("ide", pragmas.excludeIdeData);
  47. args: [],
  48. source: "key\x0a\x09^ 'i'",
  49. referencedClasses: [],
  50. //>>excludeEnd("ide");
  51. messageSends: []
  52. }),
  53. $globals.HLSUnitInvertSelectedCommand.klass);
  54. $core.addMethod(
  55. $core.method({
  56. selector: "label",
  57. protocol: 'accessing',
  58. fn: function (){
  59. var self=this;
  60. return "Invert selection";
  61. },
  62. //>>excludeStart("ide", pragmas.excludeIdeData);
  63. args: [],
  64. source: "label\x0a\x09^'Invert selection'",
  65. referencedClasses: [],
  66. //>>excludeEnd("ide");
  67. messageSends: []
  68. }),
  69. $globals.HLSUnitInvertSelectedCommand.klass);
  70. $core.addClass('HLSUnitInvertSelectedClassesCommand', $globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  71. //>>excludeStart("ide", pragmas.excludeIdeData);
  72. $globals.HLSUnitInvertSelectedClassesCommand.comment="Invert the currently selected classes on a `HLSUnitModel`";
  73. //>>excludeEnd("ide");
  74. $core.addMethod(
  75. $core.method({
  76. selector: "category",
  77. protocol: 'accessing',
  78. fn: function (){
  79. var self=this;
  80. return "Classes";
  81. },
  82. //>>excludeStart("ide", pragmas.excludeIdeData);
  83. args: [],
  84. source: "category\x0a\x09^'Classes'",
  85. referencedClasses: [],
  86. //>>excludeEnd("ide");
  87. messageSends: []
  88. }),
  89. $globals.HLSUnitInvertSelectedClassesCommand);
  90. $core.addMethod(
  91. $core.method({
  92. selector: "execute",
  93. protocol: 'executing',
  94. fn: function (){
  95. var self=this;
  96. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  97. return $core.withContext(function($ctx1) {
  98. //>>excludeEnd("ctx");
  99. $recv(self._model())._invertSelectedClasses();
  100. return self;
  101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  102. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitInvertSelectedClassesCommand)});
  103. //>>excludeEnd("ctx");
  104. },
  105. //>>excludeStart("ide", pragmas.excludeIdeData);
  106. args: [],
  107. source: "execute\x0a\x09self model invertSelectedClasses",
  108. referencedClasses: [],
  109. //>>excludeEnd("ide");
  110. messageSends: ["invertSelectedClasses", "model"]
  111. }),
  112. $globals.HLSUnitInvertSelectedClassesCommand);
  113. $core.addMethod(
  114. $core.method({
  115. selector: "isActive",
  116. protocol: 'testing',
  117. fn: function (){
  118. var self=this;
  119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  120. return $core.withContext(function($ctx1) {
  121. //>>excludeEnd("ctx");
  122. return $recv($recv(self["@model"])._selectedPackages())._notEmpty();
  123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  124. }, function($ctx1) {$ctx1.fill(self,"isActive",{},$globals.HLSUnitInvertSelectedClassesCommand)});
  125. //>>excludeEnd("ctx");
  126. },
  127. //>>excludeStart("ide", pragmas.excludeIdeData);
  128. args: [],
  129. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  130. referencedClasses: [],
  131. //>>excludeEnd("ide");
  132. messageSends: ["notEmpty", "selectedPackages"]
  133. }),
  134. $globals.HLSUnitInvertSelectedClassesCommand);
  135. $core.addMethod(
  136. $core.method({
  137. selector: "key",
  138. protocol: 'accessing',
  139. fn: function (){
  140. var self=this;
  141. return "c";
  142. },
  143. //>>excludeStart("ide", pragmas.excludeIdeData);
  144. args: [],
  145. source: "key\x0a\x09^ 'c'",
  146. referencedClasses: [],
  147. //>>excludeEnd("ide");
  148. messageSends: []
  149. }),
  150. $globals.HLSUnitInvertSelectedClassesCommand.klass);
  151. $core.addMethod(
  152. $core.method({
  153. selector: "label",
  154. protocol: 'accessing',
  155. fn: function (){
  156. var self=this;
  157. return "Invert selected classes";
  158. },
  159. //>>excludeStart("ide", pragmas.excludeIdeData);
  160. args: [],
  161. source: "label\x0a\x09^ 'Invert selected classes'",
  162. referencedClasses: [],
  163. //>>excludeEnd("ide");
  164. messageSends: []
  165. }),
  166. $globals.HLSUnitInvertSelectedClassesCommand.klass);
  167. $core.addClass('HLSUnitInvertSelectedPackagesCommand', $globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  168. //>>excludeStart("ide", pragmas.excludeIdeData);
  169. $globals.HLSUnitInvertSelectedPackagesCommand.comment="Invert the currently selected packages on a `HLSUnitModel`";
  170. //>>excludeEnd("ide");
  171. $core.addMethod(
  172. $core.method({
  173. selector: "category",
  174. protocol: 'accessing',
  175. fn: function (){
  176. var self=this;
  177. return "Packages";
  178. },
  179. //>>excludeStart("ide", pragmas.excludeIdeData);
  180. args: [],
  181. source: "category\x0a\x09^'Packages'",
  182. referencedClasses: [],
  183. //>>excludeEnd("ide");
  184. messageSends: []
  185. }),
  186. $globals.HLSUnitInvertSelectedPackagesCommand);
  187. $core.addMethod(
  188. $core.method({
  189. selector: "execute",
  190. protocol: 'executing',
  191. fn: function (){
  192. var self=this;
  193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  194. return $core.withContext(function($ctx1) {
  195. //>>excludeEnd("ctx");
  196. $recv(self._model())._invertSelectedPackages();
  197. return self;
  198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  199. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitInvertSelectedPackagesCommand)});
  200. //>>excludeEnd("ctx");
  201. },
  202. //>>excludeStart("ide", pragmas.excludeIdeData);
  203. args: [],
  204. source: "execute\x0a\x09self model invertSelectedPackages",
  205. referencedClasses: [],
  206. //>>excludeEnd("ide");
  207. messageSends: ["invertSelectedPackages", "model"]
  208. }),
  209. $globals.HLSUnitInvertSelectedPackagesCommand);
  210. $core.addMethod(
  211. $core.method({
  212. selector: "isActive",
  213. protocol: 'testing',
  214. fn: function (){
  215. var self=this;
  216. return true;
  217. },
  218. //>>excludeStart("ide", pragmas.excludeIdeData);
  219. args: [],
  220. source: "isActive\x0a\x09^true",
  221. referencedClasses: [],
  222. //>>excludeEnd("ide");
  223. messageSends: []
  224. }),
  225. $globals.HLSUnitInvertSelectedPackagesCommand);
  226. $core.addMethod(
  227. $core.method({
  228. selector: "key",
  229. protocol: 'accessing',
  230. fn: function (){
  231. var self=this;
  232. return "p";
  233. },
  234. //>>excludeStart("ide", pragmas.excludeIdeData);
  235. args: [],
  236. source: "key\x0a\x09^ 'p'",
  237. referencedClasses: [],
  238. //>>excludeEnd("ide");
  239. messageSends: []
  240. }),
  241. $globals.HLSUnitInvertSelectedPackagesCommand.klass);
  242. $core.addMethod(
  243. $core.method({
  244. selector: "label",
  245. protocol: 'accessing',
  246. fn: function (){
  247. var self=this;
  248. return "Invert selected packages";
  249. },
  250. //>>excludeStart("ide", pragmas.excludeIdeData);
  251. args: [],
  252. source: "label\x0a\x09^ 'Invert selected packages'",
  253. referencedClasses: [],
  254. //>>excludeEnd("ide");
  255. messageSends: []
  256. }),
  257. $globals.HLSUnitInvertSelectedPackagesCommand.klass);
  258. $core.addClass('HLSUnitRunTests', $globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  259. //>>excludeStart("ide", pragmas.excludeIdeData);
  260. $globals.HLSUnitRunTests.comment="Run the test cases in the currently selected classes on a `HLSUnitModel`";
  261. //>>excludeEnd("ide");
  262. $core.addMethod(
  263. $core.method({
  264. selector: "execute",
  265. protocol: 'executing',
  266. fn: function (){
  267. var self=this;
  268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  269. return $core.withContext(function($ctx1) {
  270. //>>excludeEnd("ctx");
  271. $recv(self._model())._runTests();
  272. return self;
  273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  274. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitRunTests)});
  275. //>>excludeEnd("ctx");
  276. },
  277. //>>excludeStart("ide", pragmas.excludeIdeData);
  278. args: [],
  279. source: "execute\x0a\x09self model runTests",
  280. referencedClasses: [],
  281. //>>excludeEnd("ide");
  282. messageSends: ["runTests", "model"]
  283. }),
  284. $globals.HLSUnitRunTests);
  285. $core.addMethod(
  286. $core.method({
  287. selector: "isActive",
  288. protocol: 'testing',
  289. fn: function (){
  290. var self=this;
  291. return true;
  292. },
  293. //>>excludeStart("ide", pragmas.excludeIdeData);
  294. args: [],
  295. source: "isActive\x0a\x09^true",
  296. referencedClasses: [],
  297. //>>excludeEnd("ide");
  298. messageSends: []
  299. }),
  300. $globals.HLSUnitRunTests);
  301. $core.addMethod(
  302. $core.method({
  303. selector: "key",
  304. protocol: 'accessing',
  305. fn: function (){
  306. var self=this;
  307. return "r";
  308. },
  309. //>>excludeStart("ide", pragmas.excludeIdeData);
  310. args: [],
  311. source: "key\x0a\x09^'r'",
  312. referencedClasses: [],
  313. //>>excludeEnd("ide");
  314. messageSends: []
  315. }),
  316. $globals.HLSUnitRunTests.klass);
  317. $core.addMethod(
  318. $core.method({
  319. selector: "label",
  320. protocol: 'accessing',
  321. fn: function (){
  322. var self=this;
  323. return "Run Tests";
  324. },
  325. //>>excludeStart("ide", pragmas.excludeIdeData);
  326. args: [],
  327. source: "label\x0a\x09^'Run Tests'",
  328. referencedClasses: [],
  329. //>>excludeEnd("ide");
  330. messageSends: []
  331. }),
  332. $globals.HLSUnitRunTests.klass);
  333. $core.addClass('HLSUnitSelectAllCommand', $globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  334. //>>excludeStart("ide", pragmas.excludeIdeData);
  335. $globals.HLSUnitSelectAllCommand.comment="I group the select all commands";
  336. //>>excludeEnd("ide");
  337. $core.addMethod(
  338. $core.method({
  339. selector: "key",
  340. protocol: 'accessing',
  341. fn: function (){
  342. var self=this;
  343. return "a";
  344. },
  345. //>>excludeStart("ide", pragmas.excludeIdeData);
  346. args: [],
  347. source: "key\x0a\x09^ 'a'",
  348. referencedClasses: [],
  349. //>>excludeEnd("ide");
  350. messageSends: []
  351. }),
  352. $globals.HLSUnitSelectAllCommand.klass);
  353. $core.addMethod(
  354. $core.method({
  355. selector: "label",
  356. protocol: 'accessing',
  357. fn: function (){
  358. var self=this;
  359. return "Select all";
  360. },
  361. //>>excludeStart("ide", pragmas.excludeIdeData);
  362. args: [],
  363. source: "label\x0a\x09^ 'Select all'",
  364. referencedClasses: [],
  365. //>>excludeEnd("ide");
  366. messageSends: []
  367. }),
  368. $globals.HLSUnitSelectAllCommand.klass);
  369. $core.addClass('HLSUnitSelectAllClassesCommand', $globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  370. //>>excludeStart("ide", pragmas.excludeIdeData);
  371. $globals.HLSUnitSelectAllClassesCommand.comment="Select all available test classes based on what packages are selected on a `HLSUnitModel`";
  372. //>>excludeEnd("ide");
  373. $core.addMethod(
  374. $core.method({
  375. selector: "category",
  376. protocol: 'accessing',
  377. fn: function (){
  378. var self=this;
  379. return "Classes";
  380. },
  381. //>>excludeStart("ide", pragmas.excludeIdeData);
  382. args: [],
  383. source: "category\x0a\x09^'Classes'",
  384. referencedClasses: [],
  385. //>>excludeEnd("ide");
  386. messageSends: []
  387. }),
  388. $globals.HLSUnitSelectAllClassesCommand);
  389. $core.addMethod(
  390. $core.method({
  391. selector: "execute",
  392. protocol: 'executing',
  393. fn: function (){
  394. var self=this;
  395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  396. return $core.withContext(function($ctx1) {
  397. //>>excludeEnd("ctx");
  398. $recv(self._model())._selectAllClasses();
  399. return self;
  400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  401. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitSelectAllClassesCommand)});
  402. //>>excludeEnd("ctx");
  403. },
  404. //>>excludeStart("ide", pragmas.excludeIdeData);
  405. args: [],
  406. source: "execute\x0a\x09self model selectAllClasses",
  407. referencedClasses: [],
  408. //>>excludeEnd("ide");
  409. messageSends: ["selectAllClasses", "model"]
  410. }),
  411. $globals.HLSUnitSelectAllClassesCommand);
  412. $core.addMethod(
  413. $core.method({
  414. selector: "isActive",
  415. protocol: 'testing',
  416. fn: function (){
  417. var self=this;
  418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  419. return $core.withContext(function($ctx1) {
  420. //>>excludeEnd("ctx");
  421. return $recv($recv(self["@model"])._selectedPackages())._notEmpty();
  422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  423. }, function($ctx1) {$ctx1.fill(self,"isActive",{},$globals.HLSUnitSelectAllClassesCommand)});
  424. //>>excludeEnd("ctx");
  425. },
  426. //>>excludeStart("ide", pragmas.excludeIdeData);
  427. args: [],
  428. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  429. referencedClasses: [],
  430. //>>excludeEnd("ide");
  431. messageSends: ["notEmpty", "selectedPackages"]
  432. }),
  433. $globals.HLSUnitSelectAllClassesCommand);
  434. $core.addMethod(
  435. $core.method({
  436. selector: "key",
  437. protocol: 'accessing',
  438. fn: function (){
  439. var self=this;
  440. return "c";
  441. },
  442. //>>excludeStart("ide", pragmas.excludeIdeData);
  443. args: [],
  444. source: "key\x0a\x09^ 'c'",
  445. referencedClasses: [],
  446. //>>excludeEnd("ide");
  447. messageSends: []
  448. }),
  449. $globals.HLSUnitSelectAllClassesCommand.klass);
  450. $core.addMethod(
  451. $core.method({
  452. selector: "label",
  453. protocol: 'accessing',
  454. fn: function (){
  455. var self=this;
  456. return "Select all classes";
  457. },
  458. //>>excludeStart("ide", pragmas.excludeIdeData);
  459. args: [],
  460. source: "label\x0a\x09^ 'Select all classes'",
  461. referencedClasses: [],
  462. //>>excludeEnd("ide");
  463. messageSends: []
  464. }),
  465. $globals.HLSUnitSelectAllClassesCommand.klass);
  466. $core.addClass('HLSUnitSelectAllPackagesCommand', $globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  467. //>>excludeStart("ide", pragmas.excludeIdeData);
  468. $globals.HLSUnitSelectAllPackagesCommand.comment="Select all packages with test cases on a `HLSUnitModel`";
  469. //>>excludeEnd("ide");
  470. $core.addMethod(
  471. $core.method({
  472. selector: "category",
  473. protocol: 'accessing',
  474. fn: function (){
  475. var self=this;
  476. return "Packages";
  477. },
  478. //>>excludeStart("ide", pragmas.excludeIdeData);
  479. args: [],
  480. source: "category\x0a\x09^'Packages'",
  481. referencedClasses: [],
  482. //>>excludeEnd("ide");
  483. messageSends: []
  484. }),
  485. $globals.HLSUnitSelectAllPackagesCommand);
  486. $core.addMethod(
  487. $core.method({
  488. selector: "execute",
  489. protocol: 'executing',
  490. fn: function (){
  491. var self=this;
  492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  493. return $core.withContext(function($ctx1) {
  494. //>>excludeEnd("ctx");
  495. $recv(self._model())._selectAllPackages();
  496. return self;
  497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  498. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitSelectAllPackagesCommand)});
  499. //>>excludeEnd("ctx");
  500. },
  501. //>>excludeStart("ide", pragmas.excludeIdeData);
  502. args: [],
  503. source: "execute\x0a\x09self model selectAllPackages",
  504. referencedClasses: [],
  505. //>>excludeEnd("ide");
  506. messageSends: ["selectAllPackages", "model"]
  507. }),
  508. $globals.HLSUnitSelectAllPackagesCommand);
  509. $core.addMethod(
  510. $core.method({
  511. selector: "isActive",
  512. protocol: 'testing',
  513. fn: function (){
  514. var self=this;
  515. return true;
  516. },
  517. //>>excludeStart("ide", pragmas.excludeIdeData);
  518. args: [],
  519. source: "isActive\x0a\x09^true",
  520. referencedClasses: [],
  521. //>>excludeEnd("ide");
  522. messageSends: []
  523. }),
  524. $globals.HLSUnitSelectAllPackagesCommand);
  525. $core.addMethod(
  526. $core.method({
  527. selector: "key",
  528. protocol: 'accessing',
  529. fn: function (){
  530. var self=this;
  531. return "p";
  532. },
  533. //>>excludeStart("ide", pragmas.excludeIdeData);
  534. args: [],
  535. source: "key\x0a\x09^ 'p'",
  536. referencedClasses: [],
  537. //>>excludeEnd("ide");
  538. messageSends: []
  539. }),
  540. $globals.HLSUnitSelectAllPackagesCommand.klass);
  541. $core.addMethod(
  542. $core.method({
  543. selector: "label",
  544. protocol: 'accessing',
  545. fn: function (){
  546. var self=this;
  547. return "Select all packages";
  548. },
  549. //>>excludeStart("ide", pragmas.excludeIdeData);
  550. args: [],
  551. source: "label\x0a\x09^ 'Select all packages'",
  552. referencedClasses: [],
  553. //>>excludeEnd("ide");
  554. messageSends: []
  555. }),
  556. $globals.HLSUnitSelectAllPackagesCommand.klass);
  557. });